Skip to content

Instantly share code, notes, and snippets.

@bastosmichael
Last active August 29, 2015 13:55
Show Gist options
  • Save bastosmichael/8745816 to your computer and use it in GitHub Desktop.
Save bastosmichael/8745816 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ $# -eq 0 ]
then
echo "https.sh [options] install"
elif [ $1 == 'install' ]; then
echo "Self signing SSL Certs..."
sudo mkdir /etc/nginx/ssl
cd /etc/nginx/ssl
sudo openssl genrsa -des3 -out server.key 2048
sudo openssl req -new -key server.key -out server.csr
sudo cp server.key server.key.org
sudo openssl rsa -in server.key.org -out server.key
sudo openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment