PostgreSQL · error reference
PostgreSQL SSL: certificate verify failed (self-signed certificate)
SSL error: certificate verify failed: self-signed certificate in certificate chain
The connection is encrypted, but the client was told to check who it is talking to and cannot vouch for the certificate the server sent.
What the database is telling you
With sslmode=verify-ca or verify-full (or a driver that verifies by default), the client checks the server's certificate against trusted certificate authorities. Managed databases sign theirs with the provider's own CA, which no operating system trusts out of the box — so verification fails until that CA is given to the client. verify-full also checks the host name, so connecting by IP address to a certificate issued for a name fails too.
Why it shows up in a migration
Tools moving data between clouds often verify certificates by default, and the provider's CA bundle lives on the application servers — not on the machine running the migration.
Common causes
- The provider's CA certificate (RDS, Azure, Cloud SQL, etc.) is not in the client's trust store and not passed as sslrootcert.
- Connecting by IP, or through a proxy name, that does not match the certificate's host name under verify-full.
- A self-signed server certificate on a self-hosted database.
- An outdated CA bundle after the provider rotated its certificate authority.
How to fix it
- 1
Download the provider's CA bundle and verify against it — this keeps protection against a man-in-the-middle.
postgresql://app@db.example.com:5432/shop?sslmode=verify-full&sslrootcert=/path/to/global-bundle.pem
- 2
Connect by the host name the certificate was issued for, not its IP address.
- 3
sslmode=require still encrypts the connection but skips verification. It is a stopgap: it no longer proves you reached the real server.
postgresql://app@db.example.com:5432/shop?sslmode=require
What DBShifts does about it
Connection diagnosis reports this as a TLS certificate not being trusted, and offers the same two choices: SSL mode Require, which skips the check, or Verify-full with the server's CA certificate.
Connection diagnosis
Connecting a database?
Add the database to DBShifts and the connection is tested on the spot. If it fails, you get which of these errors it is and what to change — not the driver's raw message. Once it connects, browse it, migrate it, or let an AI agent read it through the gateway with sensitive columns masked.