Skip to content

Instantly share code, notes, and snippets.

@emilisto
Created August 29, 2013 14:17
Show Gist options
  • Save emilisto/6378677 to your computer and use it in GitHub Desktop.
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.
#!/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