Last active
August 29, 2015 14:05
-
-
Save tadman/7035b69303ad89a3ce46 to your computer and use it in GitHub Desktop.
SSL Certificate Generation Boilerplate
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
#!/bin/sh | |
PF=`ruby -rsecurerandom -e 'puts SecureRandom.base64(40).gsub(/\W/, "")[0,24]'` | |
echo $PF > $1.pf | |
openssl genrsa -des3 -passout pass:$PF -out $1.key 2048 | |
openssl rsa -in $1.key -out $1.pem -passin pass:$PF | |
openssl req -new -key $1.pem -out $1.csr | |
openssl x509 -req -days 1000 -in $1.csr -signkey $1.pem -out $1.crt | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment