Am facing some below problem in my mongodb replication environment

I have 3 replica set environment with SSL enabled and ssl mode as preferSSL

3 servers has 3 different Key file with common CA file

when i try to connect the mongo shell with below command it works fine

mongo --ssl --host hostname:port --sslPEMKeyFile "/home/mongod/keyfile.pem" --sslCAFile /home/mongod/CAfile.pem

My question is how to provide these details in connection string to connect the database from application perspective

MongoDB version: 4.0.2 OS: Amazon Linux

Thanks, Vignesh

1 Answer 1


It depends on which driver you are using. https://docs.atlas.mongodb.com/driver-connection/#driver-examples

  • Our application team is using mongoose client for connecting mongodb and node.js with version 5.3.7, mongodb they are using 3.1.8
    – vignesh
    Jan 8, 2019 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.