sg_irz
(Sn Zuric)
December 13, 2023, 6:48am
1
We have existing wildcard cert from ssls named *.domainname.com. Is it possible to use this .cert for my MongoDB TLS connections?
We want to do this for us to have a uniformity in maintenance timeframe for other platforms that are using the same cert. Unlike when using LetsEncrypt (although this approach can be automated) that have 3months expiry on certificates
chris
(Chris Dellaway)
December 14, 2023, 1:55pm
2
Yes, as long as the hostnames match the wildcard.
1 Like
sg_irz
(Sn Zuric)
December 20, 2023, 9:04am
3
I’ve tried it but when my client will connect with the tls=true option, error is
unable to verify the first certificate
I did combine the .cert and the .key into a .pem file.
Then on my mongod.conf
certificateKeyFile=/path/to/file.pem
chris
(Chris Dellaway)
December 20, 2023, 12:50pm
4
That is unusual. Possibly the client system and/or runtime needs to update the ca-certificates bundle.
sg_irz
(Sn Zuric)
December 21, 2023, 1:42am
5
How can I do that? When I download the cert from ssls.com , I got 3 files (domainname.com.crt, domainname.com.key, domainname.com.ca-bundle)
chris
(Chris Dellaway)
December 21, 2023, 1:54am
6
Depends on the client, it could rely on OS trust stores or it own mechanism, drivers will have options to use a specific CAFile too.
I would expect most reputable TLS to be verifiable by an up to date system using well known trust roots.
What OS, MongoDB Version, Client are being used?
If needed the omainname.com.ca-bundle would be the one to specify as the CAFile if specifying it with the client.
sg_irz
(Sn Zuric)
December 21, 2023, 2:11am
7
My server is running on Ubuntu 22.04, MongoDB 6.0
Jack_Woehr
(Jack Woehr)
December 21, 2023, 2:12am
8
Have you tried recreating the .pem file with the .key and .crt in opposite order?
sg_irz
(Sn Zuric)
December 21, 2023, 2:16am
9
you mean running this one?
cat file.key file.crt > file.pem
MongoDB was not able to start when I do this.
Jack_Woehr
(Jack Woehr)
December 21, 2023, 2:20am
10
That’s odd. Because I’m running MongoDB just like that, with a combined file key+cert.
One suspects your files are in the wrong format.
chris
(Chris Dellaway)
December 21, 2023, 12:45pm
11
What about the client?
The client is the one performing the verification.
As mentioned already, you have the domainname.com.ca-bundle so even if ‘natively’ updating ca-certificates does not work on the client this file can be used explicitly.