Accept Node.js TLS options in AutoEncryptionTlsOptions

XMLWordPrintableJSON

    • 3
    • None
    • Hide

      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.

      Show
      Create a copy of the Kickoff Template with the issue key (NODE-XXX) in the filename and share a link to the new doc via this field.
    • Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      It would be very convenient if passing in-memory TLS PEM options (tlsCAFile, tlsCertificateKeyFile) to the driver did not require creating a temporary file to store them and passing the filename to the driver.

      For the main driver options, this is already the case because Node.js TLS options can be passed through; for AutoEncryptionTlsOptions this is currently not possible.

      Acceptance Criteria:

      • Utilize secureContext to pass tlsCAFile & tlsCertificateKeyFile as in memory options to both the auto encrypter (MongoClientOptions.autoEncryption.tlsOptions) and ClientEncryption.
        • If the driver-specific options are provided and a secure context is provided, the secure context takes precedence.

      Testing Requirements:

      • Test that both `ca` and `cert` can be provided as in-memory buffers in a secure context for auto encryption and explicit encryption (this ticket's primary motivator).
      • Test that when a secure context is provided, the secure context is passed into the tls.connect() factory method when establishing a TLS connection.
      • Test that when both the driver's TLS options (tlsCAFile & tlsCertificateKeyFile) and a secure context are provided, the secure context takes precedence over the driver TLS options.
        • In this scenario, we'll likely want to also ensure that no file access is made to obtain the contents of tlsCertificateKeyFile and tlsCAFile.

      Docs Requirements:

      • TBD (likely want both API and MongoDB manual docs to explain precedence rules)

        1.
        Validation NODE-7022 Sub-task Ready for Work Unassigned  

            Assignee:
            Durran Jordan
            Reporter:
            Anna Henningsen
            Daria Pardue
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: