Repository navigation
Conversation
The RDS branch of configureTLS set up only the primary attempt: with no sslmode it dropped every failover host, and with verify-full a fallback verified against system roots, which lack the RDS bundle.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
🤖 Reviewed by Jash’s AI agent (Codex) at No blocking finding in the full nine-file diff. The shared Nonblocking suggestion — Validation: all 17 reported CI checks are successful, including PostgreSQL 14–18 coverage. I inspected the full diff and current-head pool/TLS context; I did not run local tests or an RDS connection. The separate automated Codex review reported a usage-limit failure, so it is not additional review evidence. |
With the first host refused, the pool must fail over to the second host and verify it, and must refuse an untrusted second host rather than reach it over plaintext.
|
🤖 Adversarial review response — created by Kiran's code review agent (Amp, Claude Opus 4.6) — pull/340, follow-up commit Verdict: no blocking findings; the one non-blocking suggestion is fixed in the follow-up commit.
Source: block/pg-sprite#340, review comment 6759028049 and review 5836775297 at head |
A multi-host RDS/Aurora connection string now keeps every host, and each host gets its own verified TLS attempt against the embedded RDS bundle, the way a
CACertPathbundle already does.Why
configureTLS's RDS branch only configured the primary attempt. With nosslmode, it set verify-full on the primary and clearedFallbacks, so a writer-plus-replica URL silently lost its failover host. Withsslmode=verify-full, it gave the RDS roots to the primary only, so a fallback host verified against system roots, which do not carry the RDS bundle, and failed its handshake.What
pinEveryAttempt(newtls_attempts.go) is the per-attempt logicpinToCABundleused, now shared. For each distinct host and port it builds one verify-full attempt with its ownServerNameand the given roots, keeps the client certificate and ALPN pgx parsed for that host, leaves unix sockets without TLS, and drops plaintext and skip-verify attempts.sslmode: every host must be an RDS endpoint the bundle covers, then every host is pinned to the RDS roots. A non-RDS host fails with the newErrMixedRDSAndOtherHosts, and a GovCloud host with the existingErrRDSBundleDoesNotCoverHost, both naming the host and the remedy, rather than leaving that host on an unverified default.sslmode: each RDS attempt that asks for verification without roots gets the RDS roots. Modes that need no roots, attempts with their ownsslrootcert, and non-RDS hosts are left as pgx parsed them.sslmodeused to fall back toprefer; it now fails withErrMixedRDSAndOtherHosts.Before / after
The same connection string on both sides: a writer in
us-east-1and a replica inus-west-2, with nosslmode.With
sslmode=verify-full, the replica attempt used to keepRootCAs == niland fail against system roots; it now verifies against the RDS bundle. A single-host URL is configured exactly as before.