diff options
author | Reverite <github@reverite.sh> | 2019-03-10 19:23:23 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-03-10 19:23:23 -0700 |
commit | 41d1369391d70a9cd25bdf96cfe567975793ef5a (patch) | |
tree | 254efe33df93f8374e420c3454889d777a34b6b1 | |
parent | 229e2726cad36066afb210d7087a40cd9f955483 (diff) |
Fix streaming API always attempting to use SSL with Postgres
-rw-r--r-- | streaming/index.js | 6 |
1 files 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'); |