Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB: Error parsing command line: unrecognised option '--sslMode'

Tags:

mongodb

ssl

So being completely new to the NoSQL world, I decided to give mongodb a trial, and downloaded the following version, which I presumed supported ssl out of the box:

db version v3.2.4
git version: e2ee9ffcf9f5a94fad76802e28cc978718bb7a30
allocator: tcmalloc
modules: none
build environment:
    distarch: x86_64
    target_arch: x86_64

So when I run

mongod --sslMode requireSSL --sslPEMKeyFile C:\data\keys\server-key.pem --sslCAFile C:\data\keys\ca-crt.pem

I get the following error message:

Error parsing command line: unrecognised option '--sslMode'

try 'mongod --help' for more information

What am I missing here?

like image 854
TheoG Avatar asked Apr 01 '16 11:04

TheoG


People also ask

Why Mongo doesn't support--SSL option?

Root cause of the issue is that the mongo binary provided in the community edition does not support --ssl option. I downloaded the evaluation version for the enterprise edition and connected successfully the M001:demo mongo server.

How to find the correct log entry text in Mongo?

Since mongo has changed the log format and messages in 4.4.x onwards, we need to override the successMessage () method so that it finds the correct log entry text.

Can I use the same connection string to connect mongoshell?

If I use the same connection string to connect mongoshell it does work. Can somebody help me out? Try without extra spaces between the parameter name, the equal sign and the parameter value.


1 Answers

Faced the same issue while working on mongo-university's M001: MongoDB Basics course. The demo connection for the course expects a ssl connection but the mongo binary I had threw this error:

$ mongo "mongodb://primary:27017,replica1:27017,replica2:27017/test?replicaSet=Cluster0-shard-0" --ssl --authenticationDatabase admin --username <user_name> --password <password>
Error parsing command line: unrecognised option '--ssl'
try 'mongo --help' for more information

Root cause of the issue is that the mongo binary provided in the community edition does not support --ssl option. I downloaded the evaluation version for the enterprise edition and connected successfully the M001:demo mongo server.

More details are in mongo Jira issue SERVER:21622

like image 185
pRmdk Avatar answered Oct 10 '22 14:10

pRmdk