Created
August 29, 2013 14:17
-
-
Save emilisto/6378677 to your computer and use it in GitHub Desktop.
Script I used to generate an SSL key and sign a certificate for using with a grunt development server.
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 | |
root_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
ssl_dir=$root_dir/ssl | |
mkdir -p $root_dir/ssl | |
echo ">> Generating SSL key and certificate..." | |
rm -rf $ssl_dir/* | |
pushd $ssl_dir > /dev/null | |
openssl genrsa -out privatekey.pem 1024 | |
openssl req -new -key privatekey.pem -out certrequest.csr | |
openssl x509 -req -in certrequest.csr -signkey privatekey.pem -out certificate.pem | |
popd > /dev/null | |
echo | |
echo 'done!' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment