Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. openssl genrsa -out CAroot.key 2048
  2. openssl req -new -key CAroot.key -out CAroot.csr # CN should be different from the certificates below
  3. openssl req -x509 -days 1825 -key CAroot.key -in CAroot.csr -out CAroot.crt
  4. cat CAroot.crt CAroot.key > CAroot.pem
  5.  
  6. openssl genrsa -out mongod.key 2048
  7. openssl req -new -key mongod.key -out mongod.csr
  8. openssl x509 -req -days 1825 -in mongod.csr -CA CAroot.pem -CAkey CAroot.key -CAcreateserial -out mongod.crt
  9. cat mongod.crt mongod.key > mongod.pem
  10.  
  11. openssl genrsa -out client.key 2048
  12. openssl req -new -key client.key -out client.csr
  13. openssl x509 -req -days 1825 -in client.csr -CA CAroot.pem -CAkey CAroot.key -CAcreateserial -out client.crt
  14. cat client.crt client.key > client.pem
  15.  
  16. mongo --ssl --sslCAFile CAroot.pem --sslPEMKeyFile client.pem --authenticationDatabase production -u user -p password --host mongo.host --port 27018
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement