and followed steps given for client certificates for testing.
OS and Server details:
OS: CentOS 7 (CentOS Linux release 7.8.2003 (Core))
MongoDB Server: MongoDB server version: 4.4.6
MongoDB shell version: v4.4.6
Am I missing something?
Please let me know if you need more details on configuration.
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1 # Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.
tls:
mode: requireTLS
certificateKeyFile: /etc/ssl/test-server1.pem
CAFile: /etc/ssl/test-ca.pem
Try with --host option
as per below example from mongo docs
mongo --tls --host hostname.example.com --tlsCAFile /etc/ssl/caToValidateServerCertificates.pem
Certificates are hard. Using some CA software can help this process a lot.
Something is self signed in that chain(other than the root) start with checking the Intermediate authority, server and client certificates and see if any have the Issuer == Subject.
openssl x509 -in /path/to/server.pem -noout -subject -issuer
subject=CN = Example MongoDB
issuer=CN = Example Intermediate CA
openssl x509 -in /path/to/intermediate -noout -subject -issuer
subject=CN = Example Intermediate CA
issuer=CN = Example_ROOT_CA
Also inspecting the certificate chain presented by the server can be of value, following the appendix instructions there should only be one certificate as a bundle is not created.
It will be great help if you could please point me to any documentation or blog which describes this whole certificate creation and using those procedure in detail.
I am really stuck with this. It’s very much hard to configure and use SSL connection with MongoDB.
Is localhost your hostname?
The host parameter should match with CN from your certificate i,e when you present certificate it will verify against the server
I think the certificate needs to be generated different way if you want to connect with localhost
Is the issue still open…? i believe may not be… Just a tip… if the SSL/TLS Certificate got password, you need to pass the same thru the command line parameter : --tlsCertificateKeyFilePassword