Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-5100

x509 cert authenticate issue with Deno

    • 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?

      What problem are you facing?

      I'm always getting this 
      error: Uncaught MongoServerSelectionError: connection <monitor> to someUuid closed
      when using self-signed certificate to authenticate against remote Mongo server.

      Mongo server log says `{"error":

      {"code":141,"codeName":"SSLHandshakeFailed","errmsg":"no SSL certificate provided by peer; connection rejected"}

      `,  but I'm sure I provided these SSL certs.

      The issue won't occur with the same code on NodeJS, and I could connect to my Mongo server using Mongosh with the same URL as the Deno one.

      What driver and relevant dependency versions are you using?

      Deno: 1.30.3/1.31.1
      npm:mongodb: 5.0.1/5.1.0

      Steps to reproduce?

      Create a self-signed CA, generate certificates for Mongo server and client, and run the following code:

      import {MongoClient} from "npm:mongodb@^5.1.0"
      const mongoUrl = "mongodb://${hostname}/?directConnection=true&tls=true&tlsCAFile=${caPath}&tlsCertificateKeyFile=${certkeyPath}&authSource=%24external&authMechanism=MONGODB-X509"
      const client = new MongoClient(mongoUrl);
      await client.connect();

            Assignee:
            Unassigned Unassigned
            Reporter:
            abcde11819@live.com Qiran Wang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: