Cannot activate ssl/tls in community server

Hello, i have succsfully installed a mongodb in ubuntu 22.04. I am able to connect to it and do CRUD actions correctly. I am trying now 3 day to activate the SSL/TLS for secure connection without any success though.
I created a certifcate from certbot with the commands
sudo certbot certonly --standalone -d mysub.domain.com
which created a certificate and a privkey both .pem

then i combined them both with the following command
sudo cat /etc/letsencrypt/live/mysub.domain.com/privkey.pem /etc/letsencrypt/live/mysub.domain.com/fullchain.pem > /etc/letsencrypt/live/mysub.domain.com/mongodb.pem

I then proceed to edit the mongod.config with
sudo nano /etc/mongod.conf

and add at the following path

network interfaces

net:
port: 27017
bindIp: x.x.x.x
tls:
mode: requireTLS
certificateKeyFile: /etc/letsencrypt/live/mysub.domain.com/mongodb.pem

And after that i get all the time the error shown in the image.
Note, if remove the tls from the .conf everything works fine.

Can anyone point me out what i am doing wrong here?

Hi @Alexander_K and welcome to the community!
I see from the screenshot the error code 72 which correspond to “InvalidOptions”.
make sure the configuration file is correctly formatted (in your case you have to check the last part you add, therefore relating to the tls)

Best Regards

1 Like