Error after configure SSL/TLS cert


We are getting below mentioned connection error after configure SSL in Openshift cluster MongoDB, Could you please help to resolve this issue.

$ mongo --tls --tlsCAFile /var/run/secrets/ --tlsAllowInvalidHostnames --host=localhost:27017 --username admin --password --authenticationDatabase admin
MongoDB shell version v5.0.20
Enter password:
connecting to: mongodb://localhost:27017/?authSource=admin&compressors=disabled&gssapiServiceName=mongodb
{“t”:{“$date”:“2023-08-30T12:59:06.250Z”},“s”:“I”, “c”:“NETWORK”, “id”:5490002, “ctx”:“thread4”,“msg”:“Started a new thread for the timer service”}
Error: couldn’t connect to server localhost:27017, connection attempt failed: SocketException: stream truncated :
exception: connect failed
exiting with code 1