Securing Mongodb with TLS Authentication

While Connecting to MongoDB using tls certificates we are facing the issue

Command issued:

sudo mongo --tls --host --tlsCAFile /etc/ssl/self/root_self_CA.pem --tlsCertificateKeyFile /etc/ssl/self/mongodb_client.pem --tlsCertificateKeyFilePassword admin@123 --tlsAllowInvalidCertificates -u mongouser -p --authenticationDatabase admin

Error Log:

{“t”:{"$date":“2022-10-06T04:23:17.891-04:00”},“s”:“I”, “c”:“NETWORK”, “id”:22988, “ctx”:“conn59”,“msg”:“Error receiving request from client. Ending connection from remote”,“attr”:{“error”:{“code”:141,“codeName”:“SSLHandshakeFailed”,“errmsg”:“SSL peer certificate validation failed: self signed certificate”},“remote”:“”,“connectionId”:59}}
{“t”:{"$date":“2022-10-06T04:23:17.891-04:00”},“s”:“I”, “c”:“NETWORK”, “id”:22944, “ctx”:“conn59”,“msg”:“Connection ended”,“attr”:{“remote”:“”,“uuid”:“5f3c1381-8f37-446a-b43c-2aa7a42e0859”,“connectionId”:59,“connectionCount”:0}}

Please help me on this

It could be due to bindIp parameter
What is the value you set it to?
While connecting you are using localhost but it seems you are connecting remotely
Did you try with actual hostname instead of localhost/
What is your os?
For Mac & Windows additional param like certificateselector is available