Atlas x.509 managed certificate is not working

I’m unable to connect to the Atlas database, using the x.509 certificate generated by Atlas.

I use the paid serverless option.

I used two ways to connect one with mongosh and one with Node.js and both are not working.

This is the error I’m getting:

MongoDB connection error MongoServerError: authentication failed. User not found

The name of username is the same as the one in the certificate.

Hi @Tsu_Sun - Welcome to the community.

I use the paid serverless option.

Is the issue you’re experiencing specific to X.509 authentication AND serverless instances? I.e. Have you had any issues with the same authentication to a non-serverless instance?


Hi @Tsu_Sun, what steps are you using to connect to your serverless instance? You can easily find the connection string and relevant parameters by going to and going to your instance and selecting on “Connect”. This will bring you a pop-in window which shows various options to connect to your instance.