From 40137f52486707cdf29ed63fda9018ab36a262c7 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 29 Apr 2026 15:40:50 +0530 Subject: [PATCH 1/2] fix: use verify-full sslmode --- apps/claim-db-worker/app/web/DatabaseContext.tsx | 2 +- packages/create-db/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/claim-db-worker/app/web/DatabaseContext.tsx b/apps/claim-db-worker/app/web/DatabaseContext.tsx index 477cc46..86f840e 100644 --- a/apps/claim-db-worker/app/web/DatabaseContext.tsx +++ b/apps/claim-db-worker/app/web/DatabaseContext.tsx @@ -90,7 +90,7 @@ export const DatabaseProvider = ({ children }: DatabaseProviderProps) => { if (db) { const directConnString = db.directConnection - ? `postgresql://${db.directConnection.user}:${db.directConnection.pass}@${db.directConnection.host}?sslmode=require` + ? `postgresql://${db.directConnection.user}:${db.directConnection.pass}@${db.directConnection.host}?sslmode=verify-full` : ""; const newDbInfo = { diff --git a/packages/create-db/README.md b/packages/create-db/README.md index 7477835..c2cc351 100644 --- a/packages/create-db/README.md +++ b/packages/create-db/README.md @@ -111,7 +111,7 @@ When using `--json` with `create`, the output includes: ```json { "success": true, - "connectionString": "postgresql://user:pass@host:5432/postgres?sslmode=require", + "connectionString": "postgresql://user:pass@host:5432/postgres?sslmode=verify-full", "claimUrl": "https://create-db.prisma.io/claim?projectID=...", "deletionDate": "2025-12-13T12:00:00.000Z", "region": "us-east-1", @@ -137,7 +137,7 @@ When using `--json` with `regions`, the output is an array of region objects: When using `--env`, the following variables are appended to the specified file: ```env -DATABASE_URL="postgresql://user:pass@host:5432/postgres?sslmode=require" +DATABASE_URL="postgresql://user:pass@host:5432/postgres?sslmode=verify-full" CLAIM_URL="https://create-db.prisma.io/claim?projectID=..." ``` From 4e1f48b6a30c3fd84b86be545c3a613d1dbe0b5d Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 29 Apr 2026 15:46:59 +0530 Subject: [PATCH 2/2] fix: normalize cli sslmode --- packages/create-db/src/core/database.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/create-db/src/core/database.ts b/packages/create-db/src/core/database.ts index 700712d..69f739d 100644 --- a/packages/create-db/src/core/database.ts +++ b/packages/create-db/src/core/database.ts @@ -121,10 +121,15 @@ export async function createDatabaseCore( Boolean(c.endpoints?.direct?.connectionString) || Boolean(c.endpoints?.pooled?.connectionString), ); - const connectionString = + const rawConnectionString = connection?.endpoints?.direct?.connectionString ?? connection?.endpoints?.pooled?.connectionString ?? null; + const connectionString = + rawConnectionString?.replace( + /([?&]sslmode=)(require|prefer|verify-ca)(?=[&#]|$)/i, + "$1verify-full" + ) ?? null; const claimUrl = `${claimDbWorkerUrl}/claim?projectID=${projectId}&utm_source=${userAgent || getCommandName()}&utm_medium=cli`;