How can I connect with X509 by putting all options in the connection string in node.js driver for mongodb?

后端 未结 1 1666
梦谈多话
梦谈多话 2021-01-26 22:33

I\'m using the keys available in mongodb docs for a self-signed certificate using X509 authentication with a Node.js Driver.

When trying to connect to the database I get

相关标签:
1条回答
  • 2021-01-26 23:10

    You need to ensure both server and client can verify each other's certificates. The two verifications are independent and use different options.

    For server side see https://github.com/mongodb/mongo-ruby-driver/blob/master/.evergreen/run-tests.sh#L74, for client side see https://github.com/mongodb/mongo-ruby-driver/blob/master/.evergreen/run-tests.sh#L91. URI options are standardized across drivers.

    Also see https://github.com/mongodb/mongo-ruby-driver/blob/master/spec/README.md#x509-authentication.

    sslPEMKeyFile is a legacy node driver option (assuming it is valid), the tls* options take paths to files and not file contents.

    0 讨论(0)
提交回复
热议问题