fix(postgres): require TLS for query_render_postgres connections - #33
Open
aniruddhaadak80 wants to merge 1 commit into
Open
aniruddhaadak80 wants to merge 1 commit into
aniruddhaadak80 wants to merge 1 commit into
Conversation
Render-managed Postgres always requires SSL, but pgx defaults to sslmode=prefer, leaving a plaintext fallback that silently downgrades on any TLS hiccup and surfaces as FATAL: SSL/TLS required. Parse via a helper that upgrades TLS-less configs and drops plaintext fallbacks so IP-allowlisted instances connect like psql. Fixes render-oss#6
aniruddhaadak80
force-pushed
the
fix/postgres-require-tls
branch
from
September 26, 2026 03:02
e1df139 to
b597c35
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why
Render-managed Postgres always requires SSL. pgx defaults to sslmode=prefer (TLS primary plus a plaintext fallback), so any TLS hiccup silently downgrades to an unencrypted attempt that the server rejects with FATAL: SSL/TLS required (SQLSTATE 28000). This matches the reports in #6 where psql works but query_render_postgres fails, especially on IP-allowlisted instances.
Repro (before fix, pgx.ParseConfig on postgres://user:pass@host.ohio-postgres.render.com:5432/mydb):
After fix: primary TLS present, zero plaintext fallbacks.
How tested
Fixes #6