Developing with SSL


I’ve recently modified a site to use SSL for some of the pages, and I
have it working on the production box. However, in my development
environment, I’m using RadRails on Windows, which provides a Mongrel
server for development. Since this setup doesn’t support SSL, I can no
longer exercise the site fully in my development environment.

Is there a way to support SSL within the RadRails/Mongrel environment?
I don’t think it uses Apache at all.

I could set up an Apache+Mongrel setup on my dev box to mirror the
production box setup… is that the way to go? (I was hoping to avoid
that extra complexity, but maybe I should stop resisting…)


Michael S.


I have SSL enabled for production mode, but disabled in development/
test modes.

in application.rb

Force https usage for all links and redirects

Only do this in production mode, though, because localhost

probably doesn’t have SSL enabled

if %w(production demo).include?(ENV[‘RAILS_ENV’])
def default_url_options(options)
{ :protocol => ‘https://’ }

Does this help?

– Wes


Hi Wes,
wesgarrison wrote:

Does this help?

I meant to get back to you sooner and thank you for this after you
it last week. It was exactly what I needed. There’s another approach
was suggested on the deploy list but it involved changes both in the app
on the server. I like this better since it puts everything in the app
and I
could also extend it to conditionally apply to specific controller /

Thanks much. It really helped me.

Best regards,