Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-2187

Key file path, key file password, and certificate authority file path must be escaped in MongoDB URI

    • Type: Icon: Improvement Improvement
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • 1.7.0
    • Affects Version/s: 1.7.0
    • Component/s: None
    • None

      Allowing an unescaped "/" or other special character in the key file path, key file password, or the certificate authority file path introduces a parsing ambiguity. It violates the Connection String Spec's algorithm, which requires a driver to parse hostnames and user info from the URI segment before the last "/" character, and requires the driver to parse the options from the segment after the last "/" character. Thus we can't correctly parse a URI like this without violating the spec:

      "mongodb://server/?sslclientcertificatekeyfile=/tmp/key.pem"

      We can't parse that string while conforming to the spec, because the segment before the last "/" character is this:

      "mongodb://server/?sslclientcertificatekeyfile=/tmp"

      Instead, we must require this syntax:

      "mongodb://server/?sslclientcertificatekeyfile=%2Ftmp%2Fkey.pem"

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: