Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-3139

Mongodb 4.2 cannot communicate with each other in a cluser on TLS

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Blocker - P1
    • Resolution: Declined
    • 4.2.20
    • No versions
    • None
    • Redhat 7.9

    Description

      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.

      Attachments

        Activity

          People

            tim.fogarty@mongodb.com Tim Fogarty
            freemanliu2011@gmail.com Freeman LIU
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: