Tag: mongoose x509certificate

configurationmongoose使用x509客户端证书连接到mongodb

我想configurationmongoose连接到我的MongoDB 3.0服务器,都在本地主机上。 我的服务器conf文件如下: systemLog: destination: file path: "/var/log/mongodb/mongodb.log" logAppend: true storage: journal: enabled: true processManagement: fork: true net: port: 27017 ssl: mode: requireSSL #These are generated using my own local CA PEMKeyFile: "/etc/ssl/mongoServer.pem" CAFile: "/etc/ssl/rootCA.pem" setParameter: enableLocalhostAuthBypass: false authenticationMechanisms: MONGODB-X509 服务器运行,我可以连接到使用mongo shell,使用以下命令: mongo -ssl –sslCAFile /etc/ssl/mongoServer.pem –sslPEMKeyFile /etc/ssl/mongoClient.pem (奇怪的是,如果我使用rootCA.pem作为–sslCAFile,而不是mongoServer.pem,它不会连接,但这是另一个问题…) 大! 现在,我试图build立一个mongoose客户端连接到同一台服务器。 这里是我正在使用的configuration选项。 var dbConnectString = […]