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
This commit is contained in:
parent
fd3e1ba150
commit
19270ef6ec
1 changed files with 3 additions and 1 deletions
|
|
@ -7,8 +7,10 @@ const globalForPrisma = globalThis as unknown as {
|
||||||
};
|
};
|
||||||
|
|
||||||
function createPrismaClient() {
|
function createPrismaClient() {
|
||||||
|
const url = new URL(process.env.DATABASE_URL!);
|
||||||
|
url.searchParams.delete("sslmode");
|
||||||
const pool = new pg.Pool({
|
const pool = new pg.Pool({
|
||||||
connectionString: process.env.DATABASE_URL,
|
connectionString: url.toString(),
|
||||||
max: 5,
|
max: 5,
|
||||||
ssl: { rejectUnauthorized: false },
|
ssl: { rejectUnauthorized: false },
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue