Forum: Ruby on Rails Basic (newbie) Webrick / ssl config question

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.
Greg F. (Guest)
on 2006-01-16 18:13
(Received via mailing list)
I have a simple Intranet app I want to make accessible via the
Internet for remote access by our employees.

I want to use ssl (https) connections and I've found enough messages
to imply Webrick as included in rails can do the job.

The message at
even appears to tell me exactly how to do it by modifying "server".

The trouble is my "script/server" is a very simple 3 line script the
runs "commands/server".

Where do I find "commands/server"?

And if I only want the production environment to run SSL is that
easily accomplished?

Greg F.
The Norcross Group
Forensics for the 21st Century
Zayne K. (Guest)
on 2006-01-19 21:55
(Received via mailing list)
There might be a better way (if so, somebody say!), but for development
(winxp) I use two iWEBrick servlets -- one https servlet and one http
servlet (on different ports)

Currently, I use script/server to launch the http servlet and
script/ (see below) to launch the https servlet.

require File.dirname(__FILE__) + '/../config/boot'
#require 'commands/server'

require 'webrick'
require 'webrick/https'

  :port        => 3001,
  :ip        => "",
  :environment    => (ENV['RAILS_ENV'] || "development").dup,
  :server_root    => File.expand_path(RAILS_ROOT + "/public/"),


ENV["RAILS_ENV"] = OPTIONS[:environment]
RAILS_ENV.replace(OPTIONS[:environment]) if defined?(RAILS_ENV)

require RAILS_ROOT + "/config/environment"
require 'webrick_server'
OPTIONS['working_directory'] = File.expand_path(RAILS_ROOT)

class SSLDispatchServlet < DispatchServlet
  def self.dispatch(options)
    Socket.do_not_reverse_lookup = true
    server =        =>
                     :ServerType    => options[:server_type],
                     :BindAddress    => options[:ip],
                     :SSLEnable        => true,
                     :SSLVerifyClient    => OpenSSL::SSL::VERIFY_NONE,
                     :SSLCertName    => [ [ "CN",
WEBrick::Utils::getservername ] ]
    server.mount('/', DispatchServlet, options)
    trap("INT") { server.shutdown }
puts "=> Rails application started on
puts "=> Ctrl-c to shutdown"

Greg F. (Guest)
on 2006-01-20 02:30
(Received via mailing list)
Greatly appreciated.

I will try it out tomorrow.

On 1/19/06, Zayne K. <removed_email_address@domain.invalid> wrote:
> #require 'commands/server'
> class SSLDispatchServlet < DispatchServlet
>     server.mount('/', DispatchServlet, options)
> >
> >
> _______________________________________________
> Rails mailing list
> removed_email_address@domain.invalid

Greg F.
The Norcross Group
Forensics for the 21st Century
This topic is locked and can not be replied to.