DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Major - P3
    • None
    • Affects Version/s: 3.6.0
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Today, I changed my connection from Node.js (12.18.2) to MongoDB (4.2.9) to using SSL like so:

      MongoClient.connect("mongodb://my_user:my_password@1.3.4.5:27017/documentDB?maxPoolSize=500&ssl=true", { useNewUrlParser: true,
          useUnifiedTopology: false, 
          server: {
            sslValidate:false,
            checkServerIdentity:false
        }
      } ...
      

      The functionality seems there and everything works, however I get this warning:

      DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
          at Object.connect (_tls_wrap.js:1621:15)
          at makeConnection (.../node_modules/mongodb/lib/core/connection/connect.js:285:20)
          at connect (.../node_modules/mongodb/lib/core/connection/connect.js:30:3)
          at createConnection (.../node_modules/mongodb/lib/core/connection/pool.js:984:3)
          at Pool.connect (.../node_modules/mongodb/lib/core/connection/pool.js:553:3)
          at Server.connect (.../node_modules/mongodb/lib/core/topologies/server.js:502:15)
          at Server.connect (.../node_modules/mongodb/lib/topologies/server.js:353:25)
          at createServer (.../node_modules/mongodb/lib/operations/connect.js:430:10)
          at .../node_modules/mongodb/lib/operations/connect.js:346:14
          at parseConnectionString (.../node_modules/mongodb/lib/core/uri_parser.js:720:3)
          at connect (.../node_modules/mongodb/lib/operations/connect.js:282:3)
      

      I was surprised not being able to find anything about it neither here nor via Google. Maybe I did search wrong?

       

      Note: The reason for me to use useUnifiedTopology: false is that I need the silently (sic!) removed events for close and timeout.

      See https://jira.mongodb.org/browse/NODE-1340

      Matt Broadstone added a comment - Apr 12 2019 06:08:43 PM GMT+0000

      "These events were intentionally omitted from the unified topology, I wasn't clear that this was useful metadata for users. We were using it internally for reconnect logic, but that has been completely rewritten with the unified topology anyway.. From a user's perspective, you shouldn't ever care about connects and reconnects, just that your operation runs on a server. Is the reconnect event useful to you?"

      Yes, for me, there are necessary.

            Assignee:
            Matt Broadstone
            Reporter:
            Christian S.
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: