| stash | minor |
|---|
The CLI now handles database TLS properly, so the discoverable fix for a certificate failure is never NODE_TLS_REJECT_UNAUTHORIZED=0.
- Every CLI database connection honours
sslmodeandsslrootcertfrom the connection string — andPGSSLMODE/PGSSLROOTCERTfrom the environment when the URL carries no TLS parameters (URL wins; unlike raw node-postgres,PGSSLROOTCERTis actually consumed):verify-full(andrequire/verify-ca/prefer, kept as full verification — node-postgres's current behaviour) verifies the server certificate;no-verifyis honoured with a one-line stderr warning;disableturns TLS off. Client-certificate setups (sslcert/sslkey) pass through untouched. - CA resolution:
sslrootcert=<path>(libpq semantics — sole trust anchor;sslrootcert=systemselects the system store) →PGSSLROOTCERT→ for*.supabase.co/*.supabase.comhosts a bundled Supabase root CA (appended to the system roots) → the system store.sslmode=verify-fullagainst Supabase — direct hosts and the pgBouncer pooler — now verifies out of the box. - Certificate-verification failures — shaped centrally in the connection factory, so every command surfaces them — name the host and the supported remedies in order (
sslrootcert=…, thensslmode=no-verifyas a last resort with the consequence spelled out), and explicitly warn againstNODE_TLS_REJECT_UNAUTHORIZED=0, which is process-wide and would also disable verification for the connections carrying CipherStash credentials. - The node-postgres "SSL modes … are treated as aliases for verify-full" SECURITY WARNING no longer appears on every invocation against
sslmode=requireURLs: the CLI decides the TLS config itself and hands pg a URL with the TLS params stripped (fixes the upstream-advisory passthrough).