Skip to content

Commit 475db5c

Browse files
committed
Revert to using aws-ssl-profiles for AWS RDS SSL handling
1 parent 051390f commit 475db5c

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

apps/web/bun.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/web/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
},
2121
"dependencies": {
2222
"@t3-oss/env-nextjs": "^0.13.8",
23+
"aws-ssl-profiles": "^1.1.2",
2324
"axios": "^1.10.0",
2425
"dotenv": "^17.1.0",
2526
"drizzle-orm": "^0.44.2",

apps/web/src/db/index.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import awsCaBundle from "aws-ssl-profiles";
12
import { drizzle } from "drizzle-orm/node-postgres";
23
import { Pool } from "pg";
34
import { env } from "../env";
@@ -6,14 +7,8 @@ import * as schema from "./schema";
67
// Create a connection pool using validated environment variables
78
const pool = new Pool({
89
connectionString: env.DATABASE_URL,
9-
// For AWS RDS, we need to handle SSL differently in different environments
10-
ssl:
11-
process.env.NODE_ENV === "production"
12-
? {
13-
rejectUnauthorized: false, // AWS RDS uses self-signed certificates
14-
require: true, // But we still require SSL
15-
}
16-
: false,
10+
// Use AWS CA bundle for SSL verification
11+
ssl: awsCaBundle,
1712
});
1813

1914
// Create the database instance

0 commit comments

Comments
 (0)