-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MONGODB-X509 in version 6.0 #11333
Comments
When I read the sourcecode it seems, that you should not set a username anyway. So you should remove the username to get it working?! |
Yeah, does not work with or without username, same error. |
Looks like the MongoDB node driver team now recommends putting the username in the connection string for X509 auth. Instead of: mongoose.connect('mongodb://localhost:27017/test', {
tls: true,
tlsCAFile: ....,
tlsCertificateKeyFile: ...,
auth: {
username: 'myusername'
},
authMechanism: 'MONGODB-X509',
replicaSet: '...'
}) Do: mongoose.connect('mongodb://myusername: localhost:27017/test', {
tls: true,
tlsCAFile: ....,
tlsCertificateKeyFile: ...,
authMechanism: 'MONGODB-X509',
replicaSet: '...'
}) Here's an example in their tests: https://github.com/mongodb/node-mongodb-native/blob/00be68fbc3b6b4b27858969dddbb9c595d5da9c6/test/integration/auth/ssl_x509_connect.test.js#L93-L105 |
Fixed by c379073 |
That does not solve the problem, because username in X509 is a certificate string, which hardly can be encoded by URI component: |
Version 6+ stopped working for
MONGODB-X509
connections:connecting with
The text was updated successfully, but these errors were encountered: