Repository navigation
tls-util: trust the system store for postgres verify-full - #41347
jasonhernandez wants to merge 1 commit into
Conversation
Vendored OpenSSL looks for roots under /usr/local/ssl, which is empty in our images, so verify-full without an explicit root cert failed against servers with publicly issued certs. Load the system store found by openssl-probe for verify-full only. An explicit root cert replaces it, and verify-ca never uses it, since without a hostname check any public cert would pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
QA LLM Review1. MEDIUM -- Preserve configured trust paths in
|
Motivation
Postgres connections in
verify-fullmode without an explicit root cert could never verify a server with a publicly issued cert.mz-tls-utilbuilds the connector with vendored OpenSSL, which looks for roots under its compiled-in/usr/local/ssl. That directory is empty in our images, so no roots were loaded and the connection failed closed. This affects Postgres sources, the metadata store client (postgres-client) and mz-debug.Description
make_tlsnow starts from an empty store and picks roots by mode:verify-full, no root cert: the system bundle (/etc/ssl/certs/ca-certificates.crton Debian), located withopenssl-probethe same way native-tls does.verify-ca, no root cert: nothing, so verification fails. Without a hostname check, any publicly issued cert for any domain would pass against the system store. libpq applies the same rule tosslrootcert=system.requirewithout a root cert,disable: no change.Clearing the store also stops roots from OpenSSL's defaults or
SSL_CERT_FILEbeing trusted alongside an explicit root cert. In prod images that store was empty, so the only practical change is in environments that setSSL_CERT_FILE, such as the testdrive image.Risks
A setup that relied on
SSL_CERT_FILEplus an explicit root cert being trusted together now trusts only the root cert. Nothing in-repo does this. Every path still fails closed when roots are missing or unreadable.Verification
New test
verify_ca_ignores_default_storechecks thatverify-cawithout a root cert does not fall back to the system store. The existingverify_full_trusts_default_storecovers theverify-fullpath. Not tested against a real public-CA Postgres server or inside a production image.Release notes
This release will verify PostgreSQL connections that use
SSL MODE verify-fullwithoutSSL CERTIFICATE AUTHORITYagainst the system's trusted CA certificates.🤖 Generated with Claude Code