19

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:

SSL connection error Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have. Error 107 (net::ERR_SSL_PROTOCOL_ERROR): SSL protocol error.

And below is the log from the console, can anyone help?

[2011-05-10 07:28:43] INFO WEBrick 1.3.1 [2011-05-10 07:28:43] INFO ruby 1.8.7 (2009-06-12) [universal-darwin10.0] [2011-05-10 07:28:43] INFO WEBrick::HTTPServer#start: pid=62854 port=3000 [2011-05-10 07:28:58] ERROR bad Request-Line `UQM?x?ʾ???????c??B?????n???BU???*???98?5EDf32?A/??'.

2
  • try following the instructions at this blog post: nearinfinity.com/blogs/chris_rohr/… Commented May 9, 2011 at 23:56
  • Did you ever figure this out? I forced SSL, ran into a bug, removed all of the force SSL code and now I get nothing but error with my app... Webrick must be holding onto the configuration? How do you clear it?
    – Clay
    Commented Aug 26, 2011 at 14:14

5 Answers 5

31

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
22

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.

1
  • 1
    I already used thin and I started to get the ssl error. Then I ran the command you suggested and told the browser to trust the server anyway. Then, I stopped the server and came back with "rails s". It came back to normal. Thanks. By the way... I had this ssl error with chrome (firefox was still working). Commented Sep 27, 2014 at 21:21
3

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.

1
  • rake tmp:sessions:clear does not exist, might be useful if you provide framework version as well.
    – bkdir
    Commented Jul 23, 2020 at 15:49
1

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.

1
  • For me, this was the solution Commented Oct 21, 2020 at 5:55
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.