Skip to content

Commit 6b73e67

Browse files
committed
Fix SSL configuration for PrismaPg adapter in production
- Add ssl: { rejectUnauthorized: false } to PrismaPg adapter for production - This properly configures SSL for the Prisma PostgreSQL adapter - Should resolve 'self-signed certificate in certificate chain' error The NODE_TLS_REJECT_UNAUTHORIZED approach wasn't working with the adapter, this directly configures the adapter's SSL settings.
1 parent 9e87ff6 commit 6b73e67

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/web/src/db/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import { PrismaPg } from "@prisma/adapter-pg";
22
import { PrismaClient } from "@prisma/client";
33
import { env } from "../env";
44

5-
// Create the adapter with connection string
5+
// Create the adapter with connection string and SSL config
66
const adapter = new PrismaPg({
77
connectionString: env.DATABASE_URL,
8+
ssl: env.NODE_ENV === "production" ? { rejectUnauthorized: false } : false,
89
});
910

1011
// Create the Prisma client with the adapter

0 commit comments

Comments
 (0)