Can't connect to Mongodb using the below command

Can’t connect to MongoDB using the below command

mongod --dbpath /data/db --logpath /data/log/mongod.log --fork --replSet “M103” --keyFile /data/keyfile --bind_ip “,” --sslMode requireSSL --sslCAFile “/etc/ssl/SSLCA.pem” --sslPEMKeyFile “/etc/ssl/ssl.pem”

Getting the below when tried.

vagrant@m103:~$ more /data/log/mongod.log.2019-03-16T21-45-06
2019-03-16T21:44:43.884+0000 E NETWORK [main] cannot read certificate file: /etc/ssl/ssl.pem error:02001002:system library:fopen:No such file or directory
2019-03-16T21:44:43.892+0000 F CONTROL [main] Failed global initialization: InvalidSSLConfiguration: Can not set up PEM key file.

Can someone help me?

Found that the SSL files and key files are not available. Upon removing, the command ran successfully.

1 Like