I have a mongodb server requires x.509 certificate
. So I have to use --sslPEMKeyFile
and --sslCAFile
on mongo shell command to connect to that server. It works fine. In my dev environment, I am using --sslAllowInvalidCertificates
parameter. It works fine. But I wonder how I can use --sslAllowInvalidCertificates
through nodejs
driver. I have checked this link http://mongodb.github.io/node-mongodb-native/2.2/reference/connecting/connection-settings/
but it doesn't have the option for invalid certificates.
Mongodb – How to add `–sslAllowInvalidCertificates` on mongodb uri
mongodbmongodb-3.4
Related Question
- Mongodb – Could not add Replica Set to MongoDB Shard
- MongoDB – Specify Authentication and Target Database Separately in Connection URI
- MongoDB connection limit
- Mongodb – SSLServerHasCertificateAuthority is false but the certificate is signed by a trusted CA
- Mongodb – How to authenticate mongodb server identity via mongodb shell
- Mongodb – Connection string for connecting mongo database with SSL enabled
- MongoDB – How to Generate the Root CA.pem for SSL Certificates
Best Answer
There's a detailed post that might answer this question here:
Connecting to MongoDB over SSL with Node.js