Created
August 16, 2013 14:41
-
-
Save stevenharman/6250508 to your computer and use it in GitHub Desktop.
Generate a self-signed cert, update your hosts file, and add it to your OS X Keychain for local SSL success!
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
#!/usr/bin/env sh | |
echo "Creating a self-signed certificate..." | |
openssl req -new -newkey rsa:2048 -sha1 -days 3650 -nodes -x509 -subj "/C=US/ST=Georgia/L=Atlanta/O=BNR/CN=localhost.ssl" -keyout config/server.key -out config/server.crt | |
if ! grep -q "\blocalhost\.ssl\b" /private/etc/hosts; then | |
echo "Adding localhost.ssl to your hosts file..." | |
echo "127.0.0.1 localhost.ssl" | sudo tee -a /private/etc/hosts | |
fi | |
printf "\e[36m" | |
echo "" | |
echo "-------------------------------------" | |
echo "Some manual setup steps are required:" | |
echo "" | |
echo "Add server.crt as trusted SYSTEM (not login)" | |
echo " cert in the mac osx keychain" | |
echo "1) Open keychain tool" | |
echo "2) Drag .crt file to the 'System' Keychain" | |
echo "3) Trust everything @_@" | |
printf "\e[0m" | |
open config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment