Not sure I get the point of this. Seems way overly complicated. Why not just:
cd /etc/ssl
### 10 year expiration
openssl req -newkey rsa:2048 -new -x509 -days 3650 -nodes -out mongodb-cert.crt -keyout mongodb-cert.key
cat mongodb-cert.key mongodb-cert.crt > mongodb.pem
Then in the MongoDB config: sslMode = requireSSL
sslPEMKeyFile = /etc/ssl/mongodb.pem
The only gotcha is in your clients you may have to set a flag: "allow_self_signed" => true