You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.
We have found some errors with the data types in mongodb connections using certificates. Finally, we have solved:
"mongoose": "^4.4.16",
'use strict';
var fs = require('fs');
...
...
db: {
uri: process.env.MONGOHQ_URL || process.env.MONGOLAB_URI ||
'mongodb://172.16.1.66/mycollection',
options: {
user: 'avalverde',
pass: 'mypass...',
server: {
ssl: true,
sslValidate: false,
sslKey:
fs.readFileSync('./config/sslcerts/mongoose/metabox-key.pem'),
sslCert:
fs.readFileSync('./config/sslcerts/mongoose/metabox-cert.pem'),
sslCA: fs.readFileSync('./config/sslcerts/mongoose/ca.pem')
}
},
...
...
Finally, we had to edit config/lib/mongoose.js because the buffer of the certificates weren't Uint8Array as expected. We added the following lines.
if ( config.db.options && config.db.options.server ) {
config.db.options.server.sslCert = new Uint8Array(config.db.options.server.sslCert);
config.db.options.server.sslKey = new Uint8Array(config.db.options.server.sslKey);
}
var db = mongoose.connect(config.db.uri..................
The text was updated successfully, but these errors were encountered: