Sample Header Ad - 728x90

mongodump refuses to connect with ssl

0 votes
2 answers
799 views
I have set up my mongod instance with the following config:
net:
  port: 27017
  bindIp: 0.0.0.0
  ssl:
    mode: requireSSL
    PEMKeyFile: /config/mongo.pem
    CAFile: /config/ca.pem
    allowConnectionsWithoutCertificates: true

security:
  authorization: enabled
I can connect to it fine with mongosh:
mongosh --host=":27017" --username="root" --db="mydbname" --ssl --authenticationDatabase="admin"
But when I try to connect with mongodump using the exact same options...:
mongodump --host=":27017" --username="root" --db="mydbname" --ssl --authenticationDatabase="admin"
...It fails with the message Failed: error connecting to db server: no reachable servers. Checking the mongod logs I see the following:
{"t":{"$date":"2023-12-08T13:55:30.966+00:00"},"s":"I",  "c":"NETWORK",  "id":22943,   "ctx":"listener","msg":"Connection accepted","attr":{"remote":"","uuid":"41542a35-0815-4fb7-a618-d3ecf6b21a33","connectionId":244,"connectionCount":4}}
{"t":{"$date":"2023-12-08T13:55:30.980+00:00"},"s":"W",  "c":"NETWORK",  "id":23234,   "ctx":"conn244","msg":"No SSL certificate provided by peer"}
{"t":{"$date":"2023-12-08T13:55:30.985+00:00"},"s":"I",  "c":"NETWORK",  "id":22944,   "ctx":"conn244","msg":"Connection ended","attr":{"remote":"","uuid":"41542a35-0815-4fb7-a618-d3ecf6b21a33","connectionId":244,"connectionCount":3}}
These three lines are repeated several times until the connection times out. I'm wondering why it says No SSL certificate provided by peer when I have allowConnectionsWithoutCertificates set to true. It obviously doesn't seem to be a problem when using mongosh as it connects without a problem.
Asked by taxfree (1 rep)
Dec 8, 2023, 02:03 PM
Last activity: Dec 12, 2023, 10:18 AM