Created
May 30, 2016 16:30
-
-
Save pirj/51798f23cedc4efce49a067b3ab385de to your computer and use it in GitHub Desktop.
Generate self-signed certificate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://devcenter.heroku.com/articles/ssl-certificate-self | |
[ -z "$1" ] && echo provide file name as argument e.g. self-signed.sh server && exit 1 | |
openssl genrsa -des3 -passout pass:x -out $1.pass.key 2048 | |
openssl rsa -passin pass:x -in $1.pass.key -out $1.key | |
rm $1.pass.key | |
openssl req -new -key $1.key -out $1.csr | |
openssl x509 -req -days 365 -in $1.csr -signkey $1.key -out $1.crt | |
cat $1.key $1.crt > $1.pem | |
rm $1.key $1.crt $1.csr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment