ssl through url

This commit is contained in:
dal 2025-09-22 09:01:09 -06:00
parent e63fd79df5
commit 1adad1b6e9
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 1 additions and 8 deletions

View File

@ -60,19 +60,12 @@ export function initializePool<T extends Record<string, postgres.PostgresType>>(
}
// Create postgres client with pool configuration
// Disable SSL for local development
const isDevelopment = process.env.ENVIRONMENT === 'development' || process.env.NODE_ENV === 'development';
console.log('Database connection - ENVIRONMENT:', process.env.ENVIRONMENT, 'NODE_ENV:', process.env.NODE_ENV, 'isDevelopment:', isDevelopment);
// SSL is controlled via the connection string (e.g., ?sslmode=require)
globalPool = postgres(connectionString, {
max: poolSize,
idle_timeout: 30,
connect_timeout: 30,
prepare: true,
ssl: isDevelopment ? false : {
rejectUnauthorized: false, // Allow self-signed certificates
},
...config,
});