Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing HTTPS on Sinatra locally

Tags:

ruby

sinatra

thin

I need to test how some elements on my page behave when I access it over HTTPS - I was wondering how I could test this sinatra app locally with HTTPS. I apologize if my question doesn't even make sense, but I would like to connect to localhost through my web browser over HTTPS.

like image 778
Jordan Scales Avatar asked Jun 25 '12 16:06

Jordan Scales


1 Answers

Short answer: You can create a self-signed certificate for local development. Heroku has a brief article on how to create a self-signed SSL cert.

Once you've created your cert and key, it's pretty simple with Thin:

SSL options:
    --ssl                        Enables SSL
    --ssl-key-file PATH          Path to private key
    --ssl-cert-file PATH         Path to certificate
    --ssl-verify                 Enables SSL certificate verification
like image 102
Larsenal Avatar answered Oct 25 '22 05:10

Larsenal