Skip to content

Instantly share code, notes, and snippets.

@DR-DinoMight
Forked from trcarden/gist:3295935
Last active September 5, 2016 13:03
Show Gist options
  • Save DR-DinoMight/6da5f9e9c674ec33fd4dfdd5aa37df63 to your computer and use it in GitHub Desktop.
Save DR-DinoMight/6da5f9e9c674ec33fd4dfdd5aa37df63 to your computer and use it in GitHub Desktop.
Rails 3.2.7 SSL Localhost (no red warnings, no apache config)
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
openssl genrsa -des3 -out localhost.orig.key 2048
openssl rsa -in localhost.orig.key -out localhost.key
openssl req -new -key localhost.key -out localhost.csr
openssl x509 -req -days 365 -in localhost.csr -signkey localhost.key -out localhost.crt
thin start -p 3000 -e development
thin start -p 3001 --ssl --ssl-verify --ssl-key-file ~/.ssl/localhost.key --ssl-cert-file ~/.ssl/localhost.crt -e development
# 7) 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.
#
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment