-
Type: Bug
-
Resolution: Won't Do
-
Priority: Blocker - P1
-
None
-
Affects Version/s: 4.2.20
-
Component/s: None
-
Labels:
-
Environment:Redhat 7.9
Problem Statement/Rationale
I created a mongodb cluster with 3 virtual machines. TLS was enabled. The issues is that mongo command line cannot connect to the db. Neither can the dbs talk to eacher. The mongodb version is 4.2. I tried 5.0 and everything works. However, the 3rd party app running on it depnds on 4.2.
The error message from 4.2 is "internal error". Not very useful.
I also tried self-signed certificates and it works. The CA signed ones have been verified by openssl without problem.
Steps to Reproduce
docker run -d --rm -v /mnt/mongodb:/data/db -v /etc/pki:/etc/ssl/mongo --network host --name mongodb mongo:4.2 mongod --replSet rs0 --auth --tlsMode requireTLS --clusterAuthMode x509 --tlsCertificateKeyFile /etc/ssl/mongo/tls/certs/mongodb1.pem --tlsCAFile /etc/ssl/mongo/ca.pem --bind_ip_all --logpath /data/db/mongo.log
then then mongo to connect to it:
docker run mongodb bash
then
mongo --tls --tlsAllowInvalidHostnames --tlsCertificateKeyFile /etc/ssl/mongo/tls/certs/test.pem --tlsCAFile /etc/ssl/mongo/ca.pem
and I got the error:
connecting to: mongodb://127.0.0.1:27017/localhost?compressors=disabled&gssapiServiceName=mongodb
2022-06-20T10:32:27.543+0000 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: internal error :
connect@src/mongo/shell/mongo.js:353:17
@(connect):2:6
2022-06-20T10:32:27.545+0000 F - [main] exception: connect failed
2022-06-20T10:32:27.545+0000 E - [main] exiting with code 1
Expected Results
TLS works.
Actual Results
TLS does not work.
Additional Notes
Any additional information that may be useful to include.