File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 2020 },
2121 "dependencies" : {
2222 "@t3-oss/env-nextjs" : " ^0.13.8" ,
23- "aws-ssl-profiles" : " ^1.1.2" ,
2423 "axios" : " ^1.10.0" ,
2524 "dotenv" : " ^17.1.0" ,
2625 "drizzle-orm" : " ^0.44.2" ,
Original file line number Diff line number Diff line change 1- import awsCaBundle from "aws-ssl-profiles" ;
21import { drizzle } from "drizzle-orm/node-postgres" ;
32import { Pool } from "pg" ;
43import { env } from "../env" ;
@@ -7,8 +6,14 @@ import * as schema from "./schema";
76// Create a connection pool using validated environment variables
87const pool = new Pool ( {
98 connectionString : env . DATABASE_URL ,
10- // Use AWS CA bundle for SSL verification (we have proper certs in Docker)
11- ssl : awsCaBundle ,
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 ,
1217} ) ;
1318
1419// Create the database instance
You can’t perform that action at this time.
0 commit comments