Skip to content

Instantly share code, notes, and snippets.

@ijy
Forked from leevigraham/ssl-setup.sh
Created July 16, 2013 08:00
Show Gist options
  • Save ijy/6006718 to your computer and use it in GitHub Desktop.
Save ijy/6006718 to your computer and use it in GitHub Desktop.
A shell script to setup SSL on your localhost.
mkdir ~/Desktop/ssl
cd ~/Desktop/ssl
openssl genrsa -des3 -out server.key 1024
openssl req -new -key server.key -out server.csr
cp server.key server.key.org
openssl rsa -in server.key.org -out server.key
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
sudo cp server.crt /private/etc/apache2/server.crt
sudo cp server.key /private/etc/apache2/server.key
# Include SSL Conf in /private/etc/apache2/httpd.conf
sudo sed -i .bak 's/\#Include \/private\/etc\/apache2\/extra\/httpd-ssl.conf/Include \/private\/etc\/apache2\/extra\/httpd-ssl.conf/g' /private/etc/apache2/httpd.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment