These are chat archives for Automattic/mongoose

Jun 2017
Julio Borja Barra
Jun 06 2017 07:07
any errors?
Gabriel Csapo
Jun 06 2017 18:25
I found authorizationError: 'SELF_SIGNED_CERT_IN_CHAIN', in the mongoose logs, does any one know what this would be caused by? I am using robot mongo and the only way to get rid of it is to set Invalid Hostnames to allowed
MongoClient.connect('', {
  sslValidate: true,
  sslCA: pem,
  sslKey: cert,
  checkServerIdentity: false,
  sslAllowInvalidHostnames: true
}, function(err, db) {
it works in the command line using
mongo --ssl  --sslAllowInvalidHostnames --sslCAFile ./lib/mongo/mongo.pem --sslPEMKeyFile ./lib/mongo/mongo.cert    --host **** -u *** -p ** --authenticationDatabase admin
Gabriel Csapo
Jun 06 2017 18:57
got it!
const ca = [fs.readFileSync(path.join(__dirname, '.', '/mongo.pem'))];
and options has to be
const options = {
    auth: { authSource: 'admin'},
    uri: Mongo.formatURI(),
    server: {
        auto_reconnect: true,
        logger: console,
        poolSize: 10,
        ssl: true,
        sslCA: ca,
        sslKey: cert,
        sslCert: cert
Nick Sarafa
Jun 06 2017 19:27
hey guys. long time creeper, first time question askerer
has anybody ever implemented passportjs with Mongoose WITHOUT using express?
from passportjs documentation Passport is Express-compatible authentication middleware for Node.js.
but does that mean that express is a critical dependency for using Passport? Or can we handle the authentication lifecycle(s) from cradle to grave using Mongoose middleware?
Joshua Austill
Jun 06 2017 20:05
@nsarafa check this out for how someone uses passportjs with restify as an example
Nick Sarafa
Jun 06 2017 20:08
@jlaustill thanks for the link! I'm digging into it now!
Joshua Austill
Jun 06 2017 20:10
@nsarafa Have fun, it's doable for sure!
Aaron Bell
Jun 06 2017 23:50
ive been looking into passport for the webapp im planning on building, is that a good way to make and store user accounts with data in a DB?