How to use deactivate Webrick's SSL

前端 未结 5 954
小蘑菇
小蘑菇 2020-12-08 21:11

Last week I tried to debug with SSL activated in webbrick, but I forget how to restore the settings to default(without SSL). Every time I visit a controller, now it shows:

相关标签:
5条回答
  • 2020-12-08 21:49

    Open Chrome Developer Tools, click and hold "page reload" button, you will see some options,pick "Empty Cache and Hard Reload". Did the trick for me.

    0 讨论(0)
  • 2020-12-08 21:50

    Similarly I recieved the same error after adding config.force_ssl = true in my config/locales/application.rb file

    To remedy an SSL error, simply edit Rails.application.config.session_store :cookie_store, key: '_app_sessions' in config/initializers/session_store.rb

    Changing the '_app_sessions' name to anything else will allow you to start your rails server without ssl and without error

    0 讨论(0)
  • 2020-12-08 21:52

    I just ran into this same exact problem today. I added config.force_ssl = true to the application.rb file and got the above error. When I removed the line, the error still persisted.

    I fixed it by clearing my browser cookies (Chrome in this case) and it works again. It seems the authentication information is saved in the cookie and something i that keeps reverting our requests to HTTPS but does not authenticate correctly so you get that error. Clearing the cookie solves that issue.

    0 讨论(0)
  • 2020-12-08 22:03

    I had a similar issue but wasn't able to fix it by clearing cookies on Chrome (nor any other fixes like rake tmp:clear), and ended up switching to using thin with SSL enabled as suggested in this post:

    https://stackoverflow.com/a/11614213

    Added this to my Gemfile:

    group :development do
       gem "thin"
    end
    

    Then bundle and thin start --ssl.

    0 讨论(0)
  • 2020-12-08 22:08

    I had to use rake tmp:sessions:clear (not just rake:tmp:clear) as well as clearing cookies in the browser to fix this issue.

    0 讨论(0)
提交回复
热议问题