# Ssl\_requirement plugin: how do I override ssl\_required?

**URL:** <https://www.ruby-forum.com/t/ssl-requirement-plugin-how-do-i-override-ssl-required/96422>\
**Category:** Rails\
**Created:** [January 24, 2006, 12:37am UTC](https://www.ruby-forum.com/t/ssl-requirement-plugin-how-do-i-override-ssl-required/96422 "2006-01-24T00:37:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![seade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@seade](https://www.ruby-forum.com/u/seade)\
**Post date:** [January 24, 2006, 12:37am UTC](https://www.ruby-forum.com/t/ssl-requirement-plugin-how-do-i-override-ssl-required/96422/1 "2006-01-24T00:37:57Z")

</div>

The ssl\_requirement plugin indicates that I can override the  
ssl\_required? method. I want to use this facility to ignore the ssl  
requirement declarations when RAILS\_ENV is anything other than  
‘production’.

My question is, where do I override this?

The relevant readme is:  
[http://dev.rubyonrails.org/browser/plugins/ssl\_requirement/README](http://dev.rubyonrails.org/browser/plugins/ssl_requirement/README)

Also, does this plugin work with a WEBrick based development environment  
running on port 3000? It looks like it is totally dropping the port  
from the url.

TIA,  
Scott

---

<div class="post-metadata">

**Author:** ![seade](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/51bf81/32.png) [@seade](https://www.ruby-forum.com/u/seade)\
**Post date:** [January 24, 2006, 1:15am UTC](https://www.ruby-forum.com/t/ssl-requirement-plugin-how-do-i-override-ssl-required/96422/2 "2006-01-24T01:15:37Z")

</div>

On Jan 23, 2006, at 4:37 PM, Scott Eade wrote:

> The ssl\_requirement plugin indicates that I can override the  
> ssl\_required? method. I want to use this facility to ignore the ssl  
> requirement declarations when RAILS\_ENV is anything other than  
> ‘production’.
> 
> My question is, where do I override this?

You could do it in your ApplicationController:

class ApplicationController \< ActiveRecord::Base  
include SslRequirement

```
 alias :original_ssl_required? :ssl_required?
 def ssl_required?
   my_custom_condition_met? || original_ssl_required?
 end

```

end

> The relevant readme is:  
> [http://dev.rubyonrails.org/browser/plugins/ssl\_requirement/README](http://dev.rubyonrails.org/browser/plugins/ssl_requirement/README)
> 
> Also, does this plugin work with a WEBrick based development  
> environment  
> running on port 3000? It looks like it is totally dropping the port  
> from the url.

The SSL redirects assume that https maps to port 443. You would need  
to have a webrick running on port 3000 and port 443 (with port 443  
being the secure port).

- Jamis
