Skip to content

Commit

Permalink
Add SSL configuration to Postgres connection pool
Browse files Browse the repository at this point in the history
  • Loading branch information
MXPOL committed May 15, 2024
1 parent 46025a2 commit b56f974
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/external-db-postgres/src/connection_provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export default (cfg: PostgresConfig, _poolOptions: postgresPoolOptions) => {
max: 10,
idleTimeoutMillis: 30000,
connectionTimeoutMillis: 10000,
ssl: process.env['SSL'] ? { rejectUnauthorized: false } : {},
}
const poolOptions = _poolOptions || {}

Expand All @@ -26,7 +27,7 @@ export default (cfg: PostgresConfig, _poolOptions: postgresPoolOptions) => {
}

const filterParser = new FilterParser()
const pool = new Pool({ ...config, ...poolOptions, ssl: { rejectUnauthorized: false } })
const pool = new Pool({ ...config, ...poolOptions })

const databaseOperations = new DatabaseOperations(pool)
const dataProvider = new DataProvider(pool, filterParser)
Expand Down

0 comments on commit b56f974

Please sign in to comment.