As a newbie this might be useful to other newbies…
I needed to run a WEBrick::HTTPServer using SSL.
First thing to do is visit
Just follow the steps in the summary if you are in a hurry.
Once you have the files as described then the following code loads up
the cert and key and runs in SSL mode. It’s only demo code but is a
reasonable starting point for running up a browser with an https://…
Firefox 22.214.171.124 and IE 6.0 work fine against it - but for some reason
FireFox 2 has problems - but I’m sure it’s just a Firefox config issue.
pkey = cert = cert_name = nil
$stderr.puts “Switching to use self-signed certificate”
cert_name = [ [“C”,“JP”], [“O”,“WEBrick.Org”], [“CN”, “WWW”] ]
:Port => 8080,
:Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
:DocumentRoot => “/usr/local/webrick/htdocs”,
:SSLEnable => true,
:SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,
:SSLCertificate => cert,
:SSLPrivateKey => pkey,
:SSLCertName => cert_name