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

B

Bjorn Smedman

Hi,

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
1.3.1
[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 http://www.webrick.org/ with
modified DocumentRoot:

---
root@OpenWrt:/# cat sslserver.rb
#!/usr/local/bin/ruby
require 'webrick'
require 'webrick/https'

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,149
Members
46,695
Latest member
StanleyDri

Latest Threads

Top