Fix TLS certificate error for Supabase pooler connection

Supabase's PgBouncer pooler uses a certificate not in Node's default
CA store, causing "self-signed certificate in certificate chain" errors
on Vercel. Configure pg.Pool with ssl.rejectUnauthorized: false.

Made-with: Cursor
This commit is contained in:
Randall Stillwell 2026-04-16 00:05:00 -05:00
parent 21c863da01
commit fd3e1ba150

View file

@ -10,6 +10,7 @@ function createPrismaClient() {
const pool = new pg.Pool({
connectionString: process.env.DATABASE_URL,
max: 5,
ssl: { rejectUnauthorized: false },
});
const adapter = new PrismaPg(pool);
return new PrismaClient({ adapter });