Last active
March 7, 2016 14:20
-
-
Save seventhskye/2c79e4a65473508e2398 to your computer and use it in GitHub Desktop.
Script to create an SSL certificate.
This file contains hidden or 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/bash | |
if [ $# -eq 0 ]; then | |
echo "Usage: $0 <CERT_NAME>" | |
echo "e.g. $0 example.com" | |
else | |
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 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment