Using SSL for Development Environment

Create Folder to Save SSL Certificate

cd ~
mkdir ssl
cd ssl
Generate Simple Signing Key

openssl genrsa -des3 -out server.orig.key 2048
Enter 1234 if prompted for passphrase

Remove passphrase & Convert to RSA Key

openssl rsa -in server.orig.key -out server.key
Create Certificate Request

openssl req -new -key server.key -out server.csr
Create Self Signed Certificate

openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Add Host Entry for SSL

echo “127.0.0.1 localhost.ssl” | sudo tee -a /etc/hosts
RAILS: Run with Thin

thin start –ssl –ssl-key-file ~/ssl/server.key –ssl-cert-file ~/ssl/server.crt
Don’t forget to activate config.force_ssl = true in environment or controller

Leave a Reply

Your email address will not be published. Required fields are marked *