# Regarding ssl

**URL:** <https://www.ruby-forum.com/t/regarding-ssl/191415>\
**Category:** Rails\
**Created:** [July 12, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/regarding-ssl/191415 "2010-07-12T12:13:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [July 12, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/regarding-ssl/191415/1 "2010-07-12T12:13:40Z")

</div>

I used ssl\_requirement plugins, for secured http requests.  
I have implemented the secured http but the problem is  
that when I click for non\_ssl action it also requests with HTTPS.

suppose I used 2 actions to be secured  
I used this --\>\> ssl\_required :x, y

I don’t know where the prob is?

---

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [July 12, 2010, 1:47pm UTC](https://www.ruby-forum.com/t/regarding-ssl/191415/2 "2010-07-12T13:47:49Z")

</div>

On Jul 12, 11:13 am, HUNT HUNT [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I used ssl\_requirement plugins, for secured http requests.  
> I have implemented the secured http but the problem is  
> that when I click for non\_ssl action it also requests with HTTPS.
> 
> suppose I used 2 actions to be secured  
> I used this --\>\> ssl\_required :x, y
> 
> I don’t know where the prob is?

By default a link will always be generated with the same protocol  
(http or https) that was used to access the page, if you want  
otherwise you can pass a :protocol option to link\_to (and to the other  
similar helpers). ssl\_requirement doesn’t handle anything like this  
for you.

Fred

---

<div class="post-metadata">

**Author:** ![hunt](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/71e660/32.png) [@hunt](https://www.ruby-forum.com/u/hunt)\
**Post date:** [July 12, 2010, 1:56pm UTC](https://www.ruby-forum.com/t/regarding-ssl/191415/3 "2010-07-12T13:56:28Z")

</div>

> I don’t know where the prob is?

In routes.rb you must specify :requirement =\> { :protocol =\> ‘http(s)’}  
for every route. Yes ssl in rails is painful.
