sslmode=verify-full: the client then checks
that the server certificate is signed by a trusted CA and matches the host
name. Weaker modes such as sslmode=require encrypt the connection but do not
verify the server, so do not use them.
The certificate is issued by Let’s Encrypt, a public CA. You do not need to
download a DBHost-specific CA file. Point the client at the operating system’s
trusted CA store instead.
psql and libpq
libpq 16 or newer acceptssslrootcert=system, which uses the system CA store:
sslrootcert to your system CA bundle, for example
/etc/ssl/certs/ca-certificates.crt on Debian and Ubuntu or /etc/ssl/cert.pem
on macOS. pg_dump and pg_restore take the same connection parameters.
Node.js: pg, Prisma and Drizzle
node-postgres verifies the server against Node’s built-in CA list. Keepsslmode=verify-full in the connection string:
@prisma/adapter-pg and Drizzle with drizzle-orm/node-postgres
both use pg underneath, so the same URL works. Do not add
rejectUnauthorized: false; that turns verification off.
Python: psycopg
psycopg 3 uses libpq. With libpq 16 or newer:Troubleshooting
certificate verify failedorunable to get local issuer certificate: the client cannot find a trusted CA store. Usesslrootcert=systemwith libpq 16+, or pointsslrootcertat the system CA bundle.server certificate does not match host name: connect with the exact host name shown in the dashboard, not an IP address.sslrootcert=systemrejected: your libpq is older than 16. Use a CA bundle path instead.