From 19270ef6ec9f5c71245fb45034e4a2bb5797abd2 Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Thu, 16 Apr 2026 00:08:47 -0500 Subject: [PATCH] Strip sslmode from connection string to fix TLS override Newer pg versions treat sslmode=require as verify-full, overriding the programmatic ssl.rejectUnauthorized=false config. Strip sslmode from the URL and handle SSL entirely via the Pool ssl option. Made-with: Cursor --- src/lib/db.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/db.ts b/src/lib/db.ts index 9614244..94faebb 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -7,8 +7,10 @@ const globalForPrisma = globalThis as unknown as { }; function createPrismaClient() { + const url = new URL(process.env.DATABASE_URL!); + url.searchParams.delete("sslmode"); const pool = new pg.Pool({ - connectionString: process.env.DATABASE_URL, + connectionString: url.toString(), max: 5, ssl: { rejectUnauthorized: false }, });