No puedo conectarme a mongodb a través de mongo shell.
dominio:
sudo mongo --tls --tlsCertificateKeyFile server.pem --tlsCAFile CA_INTERMEDIATE --host "mongodb://xxx:xxx@some-url:27020/data_base?ssl=true"
error:
MongoDB shell version v4.4.3
connecting to: mongodb://some-url:27020/data_base?compressors=disabled&gssapiServiceName=mongodb&ssl=true
{"t":{"$date":"2021-01-08T14:55:17.158Z"},"s":"E", "c":"NETWORK", "id":23256, "ctx":"js","msg":"SSL peer certificate validation failed","attr":{"error":"SSL peer certificate validation failed: unable to verify the first certificate"}}
Error: couldn't connect to server some-url:27020, connection attempt failed: SSLHandshakeFailed: SSL peer certificate validation failed: unable to verify the first certificate :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1
Sin embargo, esto funciona cuando uso las mismas claves, certificados y parámetros con mongoDB Compas.
¿Alguien puede decirme qué estoy haciendo mal?