From c0f6cb3e4d1a2cf5d1540643f3ce79934f5d957b Mon Sep 17 00:00:00 2001 From: Liran Tal Date: Sun, 4 Sep 2016 01:29:28 +0300 Subject: [PATCH] feat(mongodb): support for mongodb secure connections with ssl certificates (#1472) Fixes #1349 --- config/env/production.js | 16 ++++++++++++++++ package.json | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/config/env/production.js b/config/env/production.js index 40d80d32a8..3ad416ed2a 100644 --- a/config/env/production.js +++ b/config/env/production.js @@ -1,5 +1,7 @@ 'use strict'; +var fs = require('fs'); + module.exports = { secure: { ssl: true, @@ -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 diff --git a/package.json b/package.json index df9abcfa27..fc615809bc 100644 --- a/package.json +++ b/package.json @@ -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",