Forum: Ruby on Rails Developing with SSL

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
6c4fb2e03ccc9e26d6c837989807fba9?d=identicon&s=25 Michael Slater (Guest)
on 2007-03-12 21:09
(Received via mailing list)
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 Slater
A332dcb1e051f733dc9a9bd78df3b560?d=identicon&s=25 wesgarrison (Guest)
on 2007-03-12 21:44
(Received via mailing list)
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
2b891e820c238ded365d035771603f21?d=identicon&s=25 Bill Walton (Guest)
on 2007-03-12 22:24
(Received via mailing list)
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,
This topic is locked and can not be replied to.