From 50d03c6896122614cf2e9845a77b523dfdc526c8 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 17 Feb 2025 15:21:12 -0800 Subject: [PATCH] feat(auth): enforce SSL for db connection to prevent MITM & snooping --- db/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db/index.ts b/db/index.ts index 974984d81e..1d1f0f8108 100644 --- a/db/index.ts +++ b/db/index.ts @@ -8,5 +8,8 @@ const connectionString = process.env.POSTGRES_URL || process.env.DATABASE_URL! // Disable prefetch as it is not supported for "Transaction" pool mode const client = postgres(connectionString, { prepare: false, + ssl: { + rejectUnauthorized: true, + }, }) export const db = drizzle(client)