Skip to content

Commit

Permalink
Support for mongodb secure connections with ssl certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
lirantal committed Sep 2, 2016
1 parent cf246ba commit 4704fa6
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions config/env/production.js
@@ -1,5 +1,7 @@
'use strict';

var fs = require('fs');

module.exports = {
secure: {
ssl: true,
Expand All @@ -15,6 +17,20 @@ module.exports = {
options: {
user: '',
pass: ''
/**
* Uncomment to enable ssl certificate based authentication to mongodb
* servers. Adjust the settings below for your specific certificate
* setup.
server: {
ssl: true,
sslValidate: false,
checkServerIdentity: false,
sslCA: fs.readFileSync('./config/sslcerts/ssl-ca.pem'),
sslCert: fs.readFileSync('./config/sslcerts/ssl-cert.pem'),
sslKey: fs.readFileSync('./config/sslcerts/ssl-key.pem'),
sslPass: '1234'
}
*/
},
// Enable mongoose debug mode
debug: process.env.MONGODB_DEBUG || false
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -56,7 +56,7 @@
"lusca": "~1.4.1",
"method-override": "~2.3.5",
"mocha": "~3.0.2",
"mongoose": "~4.4.8",
"mongoose": "~4.5.10",
"morgan": "~1.7.0",
"multer": "~1.2.0",
"nodemailer": "~2.5.0",
Expand Down

0 comments on commit 4704fa6

Please sign in to comment.