Thalatta
Thalatta

Reputation: 4578

Rails 4: Rack SSL enforcer ERR_SSL_PROTOCOL_ERROR with localhost

I am trying to implement the Rack SSL enforcer and I have added the Gem to my Gemfile along with adding the following like to config/application.rb:

config.middleware.use Rack::SslEnforcer

When I run rails s and go to my localhost I get the ERR_SSL_PROTOCOL_ERROR message. Is this because I am not supposed to run ssl locally (It does seem somewhat unintuitive but I also would like to just see if it (The SSL requirement) works before going to production)?

Upvotes: 0

Views: 3022

Answers (1)

tobmatth
tobmatth

Reputation: 269

You get this error message because Webrick (or whatever server you are using) serves HTTP. To serve HTTPS, use thin with the --ssloption (start two instances to serve both HTTP and HTTPS):

thin start --ssl -p 443
thin start -p 80

Upvotes: 1

Related Questions