about summary refs log tree commit diff
diff options
context:
space:
mode:
authorReverite <github@reverite.sh>2019-03-10 19:23:23 -0700
committerReverite <github@reverite.sh>2019-03-10 19:23:23 -0700
commit41d1369391d70a9cd25bdf96cfe567975793ef5a (patch)
tree254efe33df93f8374e420c3454889d777a34b6b1
parent229e2726cad36066afb210d7087a40cd9f955483 (diff)
Fix streaming API always attempting to use SSL with Postgres
-rw-r--r--streaming/index.js6
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');