I am trying to load some sample JSON data into a MongoDB database (hosted on IBM Bluemix).

The connection requires SSL, and a SSL Certificate has been provided, but I keep getting an error when I run mongoimport from the terminal (OS X).

Here is the command I am running (with sensitive data removed, of course):

mongoimport --ssl --sslAllowInvalidCertificates --host=<host_address>:<port>/admin -u <username> -p <password> --drop --file ./sample-dataset.json --db test --collection testColl --sslPEMKeyFile ./SSLCert.pem

And the error I receive:

Failed: error connecting to db server: no reachable servers, openssl error: dial tcp <host>:<port> getsockopt: connection refused

I'm new to SSL, especially when it comes to MongoDB. Am I just not using the right options/config for mongoimport?


With mongoimport you must separate host address and authentication DB

--host host_address:port --authenticationDatabase admin

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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