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
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.