Forum: Ruby WEBrick with SSL: undefined method `create_extension'...

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.
Bjorn S. (Guest)
on 2007-01-23 09:57

I'm trying to get WEBrick to run a https site but I get the following
error (it seems after keys have been generated for the cert).

root@OpenWrt:/# ruby sslserver.rb [2000-01-06 18:38:03] INFO  WEBrick
[2000-01-06 18:38:03] INFO  ruby 1.8.5 (2006-08-25) [mips-linux]
/usr/lib/ruby/1.8/webrick/ssl.rb:65:in `create_self_signed_cert':
undefined method `create_extension' for
#<OpenSSL::X509::ExtensionFactory:0x2ae594b8> (NoMethodError)
        from /usr/lib/ruby/1.8/webrick/ssl.rb:106:in `setup_ssl_context'
        from /usr/lib/ruby/1.8/webrick/ssl.rb:90:in `listen'
        from /usr/lib/ruby/1.8/webrick/server.rb:63:in `initialize'
        from /usr/lib/ruby/1.8/webrick/httpserver.rb:24:in `initialize'
        from sslserver.rb:5:in `new'
        from sslserver.rb:5

The script is the HTTPS Server example from with
modified DocumentRoot:

root@OpenWrt:/# cat sslserver.rb
require 'webrick'
require 'webrick/https'

s =
  :Port            => 2000,
  :DocumentRoot    => "/",
  :SSLEnable       => true,
  :SSLVerifyClient => ::OpenSSL::SSL::VERIFY_NONE,
  :SSLCertName => [ ["C","JP"], ["O","WEBrick.Org"], ["CN", "WWW"] ]
trap("INT"){ s.shutdown }

Thank you for any help!

Best, Bjorn
This topic is locked and can not be replied to.