Skip to content

Instantly share code, notes, and snippets.

@faridescate
Forked from leevigraham/ssl-setup.sh
Created September 6, 2016 07:56
Show Gist options
  • Save faridescate/a27a952ba311434e8bb381f2c52bf61a to your computer and use it in GitHub Desktop.
Save faridescate/a27a952ba311434e8bb381f2c52bf61a to your computer and use it in GitHub Desktop.
Create Self Signed Certificate for Apache on OSX Mountain Lion: http://www.akadia.com/services/ssh_test_certificate.html
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