# SSL self signed localhost for rails start to finish, no red warnings.
# 1) In your rails applicaiton root folder create self signed certificate
$ openssl req -new -newkey rsa:2048 -sha1 -days 365 -nodes -x509 -subj "/C=US/ST=Colorado/L=Colorado Springs/O=SW/CN=localhost.ssl" -keyout server.key -out server.crt
# 2) Add localhost.ssl to your hosts file
$ echo "127.0.0.1 localhost.ssl" | sudo tee -a /etc/hosts
# 3) Boot thin http://code.macournoyer.com/thin/
$ thin start --ssl --ssl-key-file server.key --ssl-cert-file server.crt
# 4) Add server.crt as trusted !!SYSTEM!! (not login) cert in the mac osx keychain
# Open keychain tool, drag .crt file to system, and trust everything.
# Notes:
# 1) Https traffic and http traffic can't be served from the same thin process. If you want
# both you need to start two instances on different ports.