Skip to content

Instantly share code, notes, and snippets.

@pirj pirj/
Created May 30, 2016

What would you like to do?
Generate self-signed certificate
[ -z "$1" ] && echo provide file name as argument e.g. 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
You can’t perform that action at this time.