Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-13817

[TOOLS] sslAllowInvalidHostnames bypass ssl/tls server certification validation entirely

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Won't Do
    • None
    • None
    • manual, tools
    • None

    Description

      Description

      In all Mongo-tools doc, note that sslAllowInvalidHostnames and sslAllowInvalidCertificates are deprecated, and describe the problematic behavior in the ticket.

      Engineering Description
      From the doc, it shows: --sslAllowInvalidHostnames

      Disables the validation of the hostnames in TLS/SSL certificates. Allows mongodump to connect to MongoDB instances even if the hostname in their certificates do not match the specified hostname.

      However, in our implementation, it's treated the same as SSLAllowInvalidCert which bypasses the validation checks for server certificates and allows the use of invalid certificate. 

      https://github.com/mongodb/mongo-tools-common/blob/447a935858a70d71d22b02fa9ae67e19565d66c9/db/db.go#L459

      if opts.SSLAllowInvalidCert || opts.SSLAllowInvalidHost
      { tlsConfig.InsecureSkipVerify = true }

      This behavior would cause confusion to the user and also contradicts to the document. 

      I believe this problem exists in all the tools and mongomirror.

      After some research into the issue, I found there is no setting to ignore hostname validation in tlsConfig, thus it's not possible to fix this from the tools library. Mongo Go driver needs to introduce a new flag in ClientOptions. 

      Implementation can be referred to here https://github.com/golang/go/issues/21971

      Scope of changes

      Impact to Other Docs

      MVP (Work and Date)

      Resources (Scope or Design Docs, Invision, etc.)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Anonymous Anonymous
              Jess Mokrzecki Jess Mokrzecki
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                12 weeks, 5 days ago