Skip to content

Instantly share code, notes, and snippets.

@tadman
Last active August 29, 2015 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadman/7035b69303ad89a3ce46 to your computer and use it in GitHub Desktop.
Save tadman/7035b69303ad89a3ce46 to your computer and use it in GitHub Desktop.
SSL Certificate Generation Boilerplate
#!/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