Prisma 7 - Error opening TLS connection (cockroachdb)
I migrated from Prisma 6 to Prisma 7. And i am facing client connection related error.
Database: cockroachdb
docker compose file
.env file at root
prisma client configuration
1 Reply
You chose to compile with the bot. One moment while I piece together your answer…
The error means Prisma (via
node-postgres / PrismaPg) does not trust CockroachDB’s self‑signed cert. With Prisma 7 / adapters you now need to either:
1. Disable strict verification for local/self‑signed setups
For PostgreSQL‑compatible databases you can relax verification via the connection string:
sslmode=no-verify keeps TLS encryption but skips certificate verification, similar to sslaccept=accept_invalid_certs / older behavior. [PostgreSQL SSL; RDS adapter answer]
This is also the recommended workaround for self‑signed cert issues when using the driver adapters. [DEPTH_ZERO issue; SSL errors after adapters]
2. Use full verification with a trusted CA (more secure)
If you want to keep sslmode=verify-full, you must provide the CA/root cert via sslrootcert (same idea as with Cockroach Cloud / Supabase):
sslrootcert must point to the Cockroach cluster’s CA certificate file (path is resolved relative to ./prisma). [PostgreSQL SSL; verify-full + sslrootcert]
---
Summary for your setup
For a local Docker Cockroach node with self‑signed certs, simplest is:
If you later move to Cockroach Cloud or production with proper TLS, switch back to sslmode=verify-full and include sslrootcert.
✅ Great, thanks for letting us know that this solved your question!