It’s NOT working even we provide host option.
mongo --tls --host localhost --tlsCertificateKeyFile /etc/ssl/test-client.pem --tlsCAFile /etc/ssl/test-ca.pem
MongoDB shell version v4.4.6
connecting to: mongodb://localhost:27017/?compressors=disabled&gssapiServiceName=mongodb
{"t":{"$date":"2021-08-04T02:14:38.694Z"},"s":"E", "c":"NETWORK", "id":23256, "ctx":"js","msg":"SSL peer certificate validation failed","attr":{"error":"SSL peer certificate validation failed: self signed certificate"}}
Error: couldn't connect to server localhost:27017, connection attempt failed: SSLHandshakeFailed: SSL peer certificate validation failed: self signed certificate :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1
mongo --tls --host localhost.localdomain --tlsCertificateKeyFile /etc/ssl/test-client.pem --tlsCAFile /etc/ssl/test-ca.pem A
MongoDB shell version v4.4.6
connecting to: mongodb://localhost.localdomain:27017/A?compressors=disabled&gssapiServiceName=mongodb
{"t":{"$date":"2021-08-04T02:15:22.873Z"},"s":"E", "c":"NETWORK", "id":23256, "ctx":"js","msg":"SSL peer certificate validation failed","attr":{"error":"SSL peer certificate validation failed: self signed certificate"}}
Error: couldn't connect to server localhost.localdomain:27017, connection attempt failed: SSLHandshakeFailed: SSL peer certificate validation failed: self signed certificate :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1
Please advice.