1
votes

I am trying to secure single controller actions. for this, I did changes in routes resources :facilities, constraints: { :protocol => "https" } to make it https URL. but when I fired link https://localhost:3000/facilities it gives me error on browser ->

SSL connection error

and on terminal I can see log like

[2015-10-27 11:34:00] ERROR bad Request-Line \x16\x03\x01\x00�\x01\x00\x00�\x03\x03/däo,��\x1C�B\x02%>\x01�I*����p�O\e�\x00Z�\x17Q\x00\x00\x1A�+�/\x00��'. [2015-10-27 11:34:00] ERROR bad URIH�{�\x1F�\x00\x00\x1A�+�/\x00��'. [2015-10-27 11:34:00] ERROR bad Request-Line \x16\x03\x01\x00�\x01\x00\x00�\x03\x02��T�"�ptj"���1�ʗF�\x10�Զ�kK����c\x00\x00\x14V\x00�'. [2015-10-27 11:34:00] ERROR bad Request-Line `\x16\x03\x01\x00�\x01\x00\x00�\x03\x01\x10\x10�YO\x1F.��5A\x0Fh�Z.��Ë%��z�L\x06�ߪ�T\x00\x00\x14V\x00�'.

I dont know what is wrong with this? or is there anything I am missing?

1
You can't access https from you local . you need to deploy it on server.Pardeep Saini
Thanks ... As u said I did routes changes on server too but still browser says 'SSL connection error'Gaurav Mamidwar
did you setup SSL Certificates on server.Pardeep Saini
yes I did... I followed help.ubuntu.com/12.04/serverguide/… this link to create self signed certificateGaurav Mamidwar

1 Answers

0
votes

The issue is caused by config.force_ssl = true. Even if you remove that, which you may not want, you might still have issues with WEBrick giving you this error. You could try clearing cookies, but that still might not work.

A better alternative, if it's an option for you, would be to switch to using the thin server:

group :development do
   gem "thin"
end

Then:

$ bundle
$ thin start --ssl

I try this on my machine and it works fine with me . Hope this helps you too.