fix: verify-ca requires an explicit ssl_ca file - #48
Merged
Conversation
verify-ca without an explicit ssl_ca silently fell through to
with_platform_verifier() -- full OS-trust-store validation -- instead
of erroring. The builtin driver's build_postgres_tls_connector
requires an explicit CA file for this mode (platform roots aren't
used, since macOS's strict EKU check rejects them) and errors clearly
otherwise ("verify-ca mode requires an explicit CA file...").
Added the same guard, adapted to this plugin's param-name-based error
convention (references ssl_ca by name, since these come from JSON
params rather than a UI form). verify-full without ssl_ca is
unaffected -- that mode is documented to fall back to platform trust
automatically, which is the actual distinction between the two modes.
Proved the fix live against the same self-signed-cert SSL-enabled
PostgreSQL instance used for #44/#47: verify-ca with no ssl_ca
previously failed with a confusing generic "error performing TLS
handshake"; now returns a clear, actionable error. Confirmed
verify-full and require remain unaffected.
Fixes #46.
Version suggestionBased on this PR's title (
This is informational only — no tag or release is created automatically yet. |
aesslinger
added a commit
that referenced
this pull request
Aug 19, 2026
Continuation of the beta line after PRs #45/#47/#48 (ssl_mode=require/ verify-ca/verify-full silently allowing plaintext, ssl_mode=require validating against the platform trust store instead of skipping validation, and verify-ca silently falling back to platform trust instead of requiring an explicit CA file). Also corrected three README claims that had gone stale across this session's TLS work: the ssl_mode value list was missing allow/prefer in two places, ssl_ca's description didn't note it's now required (not just optional) for verify-ca, and the pool-caching description still said host:port:database:user, missing startup_script and every TLS param folded in by #37. Verified: .tabularium re-validated clean against the live registry schema; cargo build/test (114/114)/clippy/fmt all pass; markdownlint clean; manual live-TLS smoke tests against real non-SSL and self-signed-cert SSL-enabled PostgreSQL instances covering every ssl_mode value and error path all behave as documented.
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.
Summary
verify-cawithout an explicitssl_cafile silently fell through towith_platform_verifier()— full OS-trust-store validation — instead of erroring. The builtin driver'sbuild_postgres_tls_connectorrequires an explicit CA file for this mode (platform roots aren't used, since macOS's strict EKU check rejects them) and errors clearly otherwise.Fixes #46.
Discovery context
Found while implementing #44's fix, tracing which
ssl_mode/ssl_cacombinations reach thewith_platform_verifier()fallback branch. Distinct, smaller discrepancy from #44 (which was aboutrequire's cert-validation logic) — filed separately and intentionally left out of #47.Fix
Added the same guard as the builtin, adapted to this plugin's param-name-based error convention (references
ssl_caby name, since these come from JSON params rather than a UI form):verify-fullwithoutssl_cais unaffected — that's the actual distinction between the two modes (verify-fullis documented to fall back to platform trust automatically;verify-cais not).Testing
Manual live verification against the same self-signed-cert SSL-enabled PostgreSQL instance used for #44/#47:
verify-ca, nossl_ca{"error":{...,"message":"...error performing TLS handshake"}}(confusing){"error":{...,"message":"verify-ca mode requires an explicit CA file via ssl_ca..."}}✅ (clear)verify-full, nossl_carequireAutomated: new unit test
build_tls_connector_verify_ca_without_ssl_ca_returns_a_clear_error, confirmed failing before the fix (the current code returnedOk) and passing after. Existingverify-ca-with-ssl_catests (verify_ca_cert_verifier_*,build_tls_connector_verify_ca_*) all still pass, confirming no regression in the actual chain/hostname validation logic.Test plan
cargo test --lib --bins— 114/114 pass (113 previous + 1 new)cargo clippy --all-targets -- -D warnings— cleancargo fmt --all -- --check— cleancargo build --release— cleannpx markdownlint CHANGELOG.md— clean