SSL connections to Mongos will not complete

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.0.40
    • Affects Version/s: 2.0.37
    • Component/s: None
    • Environment:
      All
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When creating an SSL connection to a mongos the documentation would get you to create it with...

      MongoClient.connect("mongodb://dumper:dumper@example.1.dblayer.com:10900,example.0.dblayer.com:10901/dbname", {
      mongos:

      { ssl: true, sslValidate: true, sslCA: ca, poolSize: 1, reconnectTries: 1 }

      ,
      }, function(err, db) { ...

      Which for other connections works, but with Mongos it will sit in a spin never connecting.

      The reason to this is that mongodb-core uses `ca` for it's certificate array. Other connections when preparing options copy the value of sslCA to ca and continue down to making their mongodb-core connection. The MongoS code doesn't do that.

      There is a workaround for anyone affected, and thats to add ca: value to the options map too like so:

      MongoClient.connect("mongodb://dumper:dumper@example.1.dblayer.com:10900,example.0.dblayer.com:10901/dbname", {
      mongos:

      { ssl: true, sslValidate: true, sslCA: ca, ca: ca, poolSize: 1, reconnectTries: 1 }

      ,
      }, function(err, db) { ...

      And the connection will then work.

              Assignee:
              Christian Amor Kvalheim
              Reporter:
              Dj Walker-Morgan
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: