I have set up a mongodb sharded cluster on debian 10 on the port 28000 which is the mongos. I am trying to use mongodump and mongorestore and I am getting the error “
error connecting to host: error configuring the connector: error configuring client, can't load client certificate: tls: private key does not match public key”.
The .pems I use are the same that I use successfully to connect within my nodejs app, mongosh, compass. However, it doesn’t work with mongodump & mongorestore.
This is the command i use, for example for mongorestore:
mongorestore --drop --preserveUUID --maintainInsertionOrder --stopOnError --uri="mongodb://myserver.mydomain.com:28000" --ssl --sslPEMKeyFile="/player22/shared/ssl/cert-plus-key-decrypted.pem" --sslCAFile="/player22/shared/ssl/ca.pem" --username="backupUser" --password="<removed>" --authenticationDatabase="admin" --gzip --archive="toto.gz"
Do you know what is wrong? And what could make the same keys refused by mongorestore, but accepted by nodejs driver, mongosh, compass?