Assumes you will be running your local app at local.dev
, and already have a hosts file entry for this domain pointing to 127.0.0.1
.
openssl req -new -newkey rsa:2048 -sha1 -days 365 -nodes -x509 -keyout ~/path/to/local.dev.key -out ~/path/to/local.dev.crt
You can leave all the address and organization info blank.
For the common name use local.dev
, or *.local.dev
if you want to access subdomains.
Add the cert to keychain
open /Applications/Utilities/Keychain\ Access.app ~/path/to/local.dev.crt
Follow these instructions to trust the cert: https://gist.github.com/jed/6147872#avoid-https-warnings-by-telling-os-x-to-trust-the-certificate
thin start --ssl --ssl-key-file ~/path/to/local.dev.key --ssl-cert-file ~/path/to/local.dev.crt
https://gist.github.com/jed/6147872
https://gist.github.com/trcarden/3295935#gistcomment-772362