Compare Page Revisions
« Older Revision - Back to Page History - Newer Revision »
mkdir MyRootCA
openssl genrsa -out MyRootCA.key 2048
openssl req -x509 -new -key MyRootCA.key -days 365 -out MyRootCA.crt
type MyRootCA.crt MyRootCA.key > MyRootCA.pem
cat MyRootCA.crt MyRootCA.key > MyRootCA.pem
HOSTNAME
SET HOSTNAME=PublicDnsOfServer SET ROOTCA=MyRootCA
HOSTNAME='PublicDnsOfServer' ROOTCA='MyRootCA' export HOSTNAME export ROOTCA
%HOSTNAME%
$HOSTNAME
%ROOTCA%
$ROOTCA
mkdir %HOSTNAME% CD %HOSTNAME%
openssl genrsa -out %HOSTNAME%.key 2048
openssl req -new -key %HOSTNAME%.key -out %HOSTNAME%.csr
openssl x509 -req -in %HOSTNAME%.csr -CA ..\%ROOTCA%\%ROOTCA%.crt -CAkey ..\%ROOTCA%\%ROOTCA%.key -CAcreateserial -out %HOSTNAME%.crt -days 500
openssl verify -CAfile ..\%ROOTCA%\%ROOTCA%.crt %HOSTNAME%.crt
HOSTNAME.crt: OK
type %HOSTNAME%.crt %HOSTNAME%.key > %HOSTNAME%.pem
cat
type
/home/ec2-user
MyRootCA.crt
MyMongoServer.com.pem
cd /etc/ssl mv /home/ec2-user/MyRootCA.crt . mv /home/ec2-user/MyMongoServer.com.pem .
chown root:root MyRootCA.crt chown root:root MyMongoServer.com.pem
/etc/mongod.conf
net:
ssl: mode: requireSSL PEMKeyFile: /etc/ssl/MyMongoServer.com.pem CAFile: /etc/ssl/MyMongoServer.com.crt
cat /etc/mongod.conf | grep ssl
service mongod status service mongod stop service mongod status service mongod start service mongod status
mongo )-ssl )-sslCAFile "/etc/ssl/MyRootCA.crt" )-sslPEMKeyFile "/etc/ssl/MyMongoServer.com.pem" )-host MyMongoServer.com -u root admin -p
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.