I'm working on configuring my Mongo 4.2 with TLS using minikube.
These are my arguments: --auth --tlsMode requireTLS --tlsCertificateKeyFile /etc/ssl/mongodb-test-ca.crt --tlsCAFile /etc/ssl/test-ca.pem --oplogSize 32 --quiet --replSet myreplicaset --logpath /dev/stdout
I'm getting this error:
cannot read certificate file: /etc/ssl/mongodb-test-ca.key error:0909006C:PEM routines:get_name:no start line
It looks like there is some problem with the .pem files that I'm using. To configure them, I've followed the instructions here https://www.mongodb.com/docs/manual/appendix/security/appendixA-openssl-ca/
More specifically, the commands I've used are, after creating that openssl-test-ca.cnf
file that they suggest are:
openssl genrsa -out mongodb-test-ca.key 4096
openssl req -new -x509 -days 1826 -key mongodb-test-ca.key -out mongodb-test-ca.crt -config openssl-test-ca.cnf
openssl genrsa -out mongodb-test-ia.key 4096
openssl req -new -key mongodb-test-ia.key -out mongodb-test-ia.csr -config openssl-test-ca.cnf
openssl x509 -sha256 -req -days 730 -in mongodb-test-ia.csr -CA mongodb-test-ca.crt -CAkey mongodb-test-ca.key -set_serial 01 -out mongodb-test-ia.crt -extfile openssl-test-ca.cnf -extensions v3_ca
cat mongodb-test-ca.crt mongodb-test-ia.crt > test-ca.pem
What am I doing wrong? One idea is that the files that I'm using were not the correct ones, but I'm only seeing one .pem file on my process, the test-ca.pem
. For the key tlsCertificateKeyFile
I've tested also mongodb-test-ca.key
and mongodb-test-ia.key
without success