Skip to content

Commit

Permalink
Merge pull request #171 from ctigeek/master
Browse files Browse the repository at this point in the history
Support MongoDB SSL connections.
  • Loading branch information
wulfsolter committed Feb 3, 2016
2 parents 983d73b + dfcfcb6 commit 9579497
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.default.js
Expand Up @@ -24,6 +24,7 @@ if (process.env.VCAP_SERVICES) {
port: 27017,
url: '"mongodb://localhost:27017/db',
username: 'admin',
ssl: false
};
}

Expand All @@ -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,

Expand Down
1 change: 1 addition & 0 deletions lib/db.js
Expand Up @@ -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;
Expand Down

0 comments on commit 9579497

Please sign in to comment.