Reputation: 193
I have a mongodb server v 3.2 configured to use ssl for client connections, with a custom-generated certificate. I can connect to the server using mongo.exe with the following format:
C:\mongodb\bin>mongo.exe myhost:27017/mydb --sslPEMKeyFile C:\etc\ssl\mongodb.pem --ssl --username myuser --password mypassword --sslAllowInvalidCertificates
Is it possible to write an equal mongodb connection string (mongodb://....)? According to the documentation, there is the only ssl parameter, that seems to be not enough.
Upvotes: 2
Views: 12387
Reputation: 9
This works:
mongo --host server --ssl --sslCAFile C:\Path\mongodb-server.pem
--sslPEMKeyFile C:\Path\mongodb-client.pem --sslPEMKeyPassword
password -u user -p --authenticationDatabase admin
Upvotes: -1
Reputation: 516
Could you try to connect to mongo.exe with the parameter like below:
"mongodb://myuser:mypassword@myhost:27017/mydb?ssl=true&sslAllowInvalidCertificates=true&sslPEMKeyFile=C:/etc/ssl/mongodb.pem"
Upvotes: 3