From 41d1369391d70a9cd25bdf96cfe567975793ef5a Mon Sep 17 00:00:00 2001 From: Reverite Date: Sun, 10 Mar 2019 19:23:23 -0700 Subject: Fix streaming API always attempting to use SSL with Postgres --- streaming/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/streaming/index.js b/streaming/index.js index 869186934..bf7218e8a 100644 --- a/streaming/index.js +++ b/streaming/index.js @@ -89,7 +89,6 @@ const startWorker = (workerId) => { host: process.env.DB_HOST || pg.defaults.host, port: process.env.DB_PORT || pg.defaults.port, max: 10, - ssl: !!process.env.DB_SSLMODE && process.env.DB_SSLMODE !== 'disable' ? true : undefined, }, production: { @@ -99,10 +98,13 @@ const startWorker = (workerId) => { host: process.env.DB_HOST || 'localhost', port: process.env.DB_PORT || 5432, max: 10, - ssl: !!process.env.DB_SSLMODE && process.env.DB_SSLMODE !== 'disable' ? true : undefined, }, }; + if (!!process.env.DB_SSLMODE && process.env.DB_SSLMODE !== 'disable') { + pgConfigs.development.ssl = true; + pgConfigs.production.ssl = true; + } const app = express(); app.set('trusted proxy', process.env.TRUSTED_PROXY_IP || 'loopback,uniquelocal'); -- cgit