From 46025a235d1e48867b173d64600f7a9a77534050 Mon Sep 17 00:00:00 2001 From: Max Polsky Date: Wed, 15 May 2024 13:28:24 +0300 Subject: [PATCH 1/5] Add SSL configuration to Postgres connection pool --- libs/external-db-postgres/src/connection_provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/external-db-postgres/src/connection_provider.ts b/libs/external-db-postgres/src/connection_provider.ts index 211b5ac84..659a5562c 100644 --- a/libs/external-db-postgres/src/connection_provider.ts +++ b/libs/external-db-postgres/src/connection_provider.ts @@ -26,7 +26,7 @@ export default (cfg: PostgresConfig, _poolOptions: postgresPoolOptions) => { } const filterParser = new FilterParser() - const pool = new Pool({ ...config, ...poolOptions }) + const pool = new Pool({ ...config, ...poolOptions, ssl: { rejectUnauthorized: false } }) const databaseOperations = new DatabaseOperations(pool) const dataProvider = new DataProvider(pool, filterParser) From b56f97415bf74d6e5b598904d8918098e8e736d7 Mon Sep 17 00:00:00 2001 From: Max Polsky Date: Wed, 15 May 2024 14:08:03 +0300 Subject: [PATCH 2/5] Add SSL configuration to Postgres connection pool --- libs/external-db-postgres/src/connection_provider.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/external-db-postgres/src/connection_provider.ts b/libs/external-db-postgres/src/connection_provider.ts index 659a5562c..c0a6a9c5d 100644 --- a/libs/external-db-postgres/src/connection_provider.ts +++ b/libs/external-db-postgres/src/connection_provider.ts @@ -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 || {} @@ -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) From b2b944a5bb8d4218fda6bddd6bdafb2662b0ea6d Mon Sep 17 00:00:00 2001 From: Max Polsky Date: Wed, 15 May 2024 14:13:53 +0300 Subject: [PATCH 3/5] Update SSL configuration in Postgres connection pool --- libs/external-db-postgres/src/connection_provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/external-db-postgres/src/connection_provider.ts b/libs/external-db-postgres/src/connection_provider.ts index c0a6a9c5d..42072df5f 100644 --- a/libs/external-db-postgres/src/connection_provider.ts +++ b/libs/external-db-postgres/src/connection_provider.ts @@ -18,7 +18,7 @@ export default (cfg: PostgresConfig, _poolOptions: postgresPoolOptions) => { max: 10, idleTimeoutMillis: 30000, connectionTimeoutMillis: 10000, - ssl: process.env['SSL'] ? { rejectUnauthorized: false } : {}, + ssl: process.env['SSL'] === 'ture' ? { rejectUnauthorized: false } : {}, } const poolOptions = _poolOptions || {} From 29904550c87c6ff1f0c153a5f4dfe75591939a25 Mon Sep 17 00:00:00 2001 From: Max Polsky Date: Wed, 15 May 2024 14:14:26 +0300 Subject: [PATCH 4/5] Update SSL configuration in Postgres connection pool --- libs/external-db-postgres/src/connection_provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/external-db-postgres/src/connection_provider.ts b/libs/external-db-postgres/src/connection_provider.ts index 42072df5f..5ff4e3457 100644 --- a/libs/external-db-postgres/src/connection_provider.ts +++ b/libs/external-db-postgres/src/connection_provider.ts @@ -18,7 +18,7 @@ export default (cfg: PostgresConfig, _poolOptions: postgresPoolOptions) => { max: 10, idleTimeoutMillis: 30000, connectionTimeoutMillis: 10000, - ssl: process.env['SSL'] === 'ture' ? { rejectUnauthorized: false } : {}, + ssl: process.env['SSL'] === 'true' ? { rejectUnauthorized: false } : {}, } const poolOptions = _poolOptions || {} From 80d2f1bca7af468ea824d7838b88ca24add9cc7b Mon Sep 17 00:00:00 2001 From: Max Polsky Date: Wed, 15 May 2024 14:31:54 +0300 Subject: [PATCH 5/5] Update SSL configuration in Postgres connection pool --- libs/external-db-postgres/src/connection_provider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/external-db-postgres/src/connection_provider.ts b/libs/external-db-postgres/src/connection_provider.ts index 5ff4e3457..ce5ec70f7 100644 --- a/libs/external-db-postgres/src/connection_provider.ts +++ b/libs/external-db-postgres/src/connection_provider.ts @@ -18,7 +18,7 @@ export default (cfg: PostgresConfig, _poolOptions: postgresPoolOptions) => { max: 10, idleTimeoutMillis: 30000, connectionTimeoutMillis: 10000, - ssl: process.env['SSL'] === 'true' ? { rejectUnauthorized: false } : {}, + ssl: process.env['SSL'] === 'true' ? { rejectUnauthorized: false } : undefined, } const poolOptions = _poolOptions || {}