From 7fc20f7df8f41b6f39657a54bdbe8d8eed5bc167 Mon Sep 17 00:00:00 2001 From: Steven Swenson Date: Tue, 2 Feb 2016 15:38:07 -0500 Subject: [PATCH 1/2] Support SSL when making DB connection. --- lib/db.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/db.js b/lib/db.js index 00c9c8ade..e68e551e5 100644 --- a/lib/db.js +++ b/lib/db.js @@ -11,6 +11,7 @@ let connect = function(config) { let dbOptions = { auto_reconnect: config.mongodb.autoReconnect, poolSize: config.mongodb.poolSize, + ssl: config.mongodb.useSSL }; let db; From dfcfcb6312af173754c5b91d74b8f9ce27a7a3f1 Mon Sep 17 00:00:00 2001 From: Steven Swenson Date: Tue, 2 Feb 2016 15:40:16 -0500 Subject: [PATCH 2/2] Support SSL in configuration and set export variable. --- config.default.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.default.js b/config.default.js index 2ee7a508f..8a8c93ecc 100644 --- a/config.default.js +++ b/config.default.js @@ -24,6 +24,7 @@ if (process.env.VCAP_SERVICES) { port: 27017, url: '"mongodb://localhost:27017/db', username: 'admin', + ssl: false }; } @@ -32,6 +33,9 @@ module.exports = { server: process.env.ME_CONFIG_MONGODB_SERVER || mongo.host, port: process.env.ME_CONFIG_MONGODB_PORT || mongo.port, + //useSSL: connect to the server using secure SSL + useSSL: process.env.ME_CONFIG_MONGODB_SSL || mongo.ssl, + //autoReconnect: automatically reconnect if connection is lost autoReconnect: true,