From: Mike Houghton Date: 2007-02-02T00:47:25+09:00 Subject: Re: WEBrick::HTTPServer config Patrick Wauters wrote: > Did you check: > http://microjet.ath.cx/webrickguide/html/html_webrick.html > & http://microjet.ath.cx/webrickguide/html/Server_Configuration.html > in specific? > > Cheers, > > Patrick. > -- Thanks for the replies guys. I've got a little further but still struggling (Ruby newbie!) I've created an SSL key (key.pem) and certificate (cert.pem) using OpenSSL and have incorporated them into ruby like this ================ pkey = cert = cert_name = nil begin pkey = OpenSSL::PKey::RSA.new(File.read("/home/mhoughton/sslcert/key.pem")) cert = OpenSSL::X509::Certificate.new(File.read("/home/mhoughton/sslcert/cert.pem")) rescue $stderr.puts "Switching to use self-signed certificate" cert_name = [ ["C","JP"], ["O","WEBrick.Org"], ["CN", "WWW"] ] end s=WEBrick::HTTPServer.new( :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 ) s.start ============== The key and certificate files are present(!) and can be read using File.read() but the code bombs out on RSA.new() ( or on Certificate.new if I swap the order) and the rescue block is executed and the created HTTPServer doesn't use the supplied key and certificate. What am I doing wrong? Thanks Mike -- Posted via http://www.ruby-forum.com/.