diff --git a/src/index.js b/src/index.js index 67761fbd0..72aa722a6 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,8 @@ const app = express() const helmet = require('helmet') const mongoose = require('mongoose') const morgan = require('morgan') +const path = require('path') +const fs = require('fs') const configureRoutes = require('./routes.config') const dbUtils = require('./utils/db') @@ -58,13 +60,14 @@ if (process.env.USE_AWS_CERT) { // Connect to MongoDB database const dbConnectionStr = dbUtils.getMongoConnectionString() if (awsCERTFile) { + const ca = [fs.readFileSync(path.join(__dirname, 'config/global-bundle.pem'))] mongoose.connect(dbConnectionStr, { useNewUrlParser: true, useUnifiedTopology: true, useFindAndModify: false, useCreateIndex: true, ssl: true, - ca: '' + sslCA: ca }) } else { console.log('NOT USING AWS CERT FILE')