Easily create a certificate authority for your local network. Thereafter you can create client and server certificates for many different usages. It's really very fun and empowering!
Compiled by Phazor / Cascade 1733 from different sources on the web.
Please feel free to copy, distribute and change it in any way you like.
- jump to the ca/ directory
- bin/clean.sh
- bin/initialize.sh
- edit config/*.conf to your liking, especially this parts:
[ req_distinguished_name ]
[ alternate_names ]
- run bin/create-root-ca.sh
- run bin/create-nginx-server.sh or any other script.
- Create a root ca from above instructions.
- We are still running from the ca/ directory
- intermediate/bin/clean-intermediate.sh
- intermediate/bin/initialize-intermediate.sh
- edit intermediate/config/*.conf to your liking, especially this parts:
[ req_distinguished_name ]
[ alternate_names ]
- run intermediate/bin/create-intermediate-ca.sh
- run intermediate/bin/create-intermediate-nginx-server.sh or any other script.
- Common Name has to be unique or process will fail, but ...
- You can edit index.txt and change registered CN to something random and circumvent 1.
- Pass phrase for Root CA is a very, very, very good option.
- If you want strict pass phrase policy: edit the scripts accordingly.
NGINX_DIR=/etc/nginx/ssl
rm csr/nginx.csr.pem
mv private/nginx.key.pem $NGINX_DIR
mv certs/nginx.cert.pem $NGINX_DIR
cat $NGINX_DIR/nginx.cert.pem > $NGINX_DIR/nginx.cert.chain.pem
cat $NGINX_DIR/ca.cert.pem >> $NGINX_DIR/nginx.cert.chain.pem