0

Hello I have been following this tutorial to enable SSL certificates using WEBrick, Rails 4 and RubyMine

http://www.networkworld.com/columnists/2007/090507-dr-internet.html

The problem is that when I fire this script and I visit https://localhost:3443 it only shows me the list of files, I would like to know what I'm doing wrong this is my code thanks :):

#!/usr/local/bin/ruby

require 'webrick'
require 'webrick/https'
require 'openssl'

pkey = cert = cert_name = nil

begin

pkey = OpenSSL::PKey::RSA.new(File.open('ssl/server.key').read)

cert = OpenSSL::X509::Certificate.new(File.open('ssl/server.crt').read)

end

s=WEBrick::HTTPServer.new(

:Port => 3443,

:Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),

:DocumentRoot => "./public",

:SSLEnable => true,

:SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,

:SSLCertificate => cert,

:SSLPrivateKey => pkey,

:SSLCertName => [ [ "CN",WEBrick::Utils::getservername ] ]
)

s.start
Cœur
  • 34,719
  • 24
  • 185
  • 251
Rodrigo Montano
  • 193
  • 4
  • 13

0 Answers0