Created
September 30, 2015 11:54
-
-
Save seventhskye/f253f577c0788e862849 to your computer and use it in GitHub Desktop.
Quick script to generate a self signed certificate. See https://en.wikipedia.org/wiki/Certificate_signing_request for details of the CSR parameters.
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/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 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment