我如何在node.js中使用Mongo db ssl连接和用户auth

时间:2017-01-10 15:16:27

标签: node.js mongodb

当我在node.js + mongoose中使用ssl连接用户auth时,我收到错误
            [MongoError:连接0到localhost:27017关闭]

 var o = {
    server: {
            auto_reconnect:true,
            sslValidate:true,
            sslCA: ca,
            sslKey: key,
            sslCert:cert,
            sslPass:'123@xyz' 
        }, 
        user: 'User',
        pass: 'xxx123xxx'
    };

    mongoose.connect('mongodb://localhost:27017/collar',o);

请帮助我:(

0 个答案:

没有答案