Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 82fcc0bd2d
Fetching contributors…

Cannot retrieve contributors at this time

executable file 43 lines (33 sloc) 0.971 kb
#!/usr/bin/env ruby
require 'webrick'
require 'webrick/https'
require 'openssl'
require 'pp'
pkey = cert = cert_name = nil
begin
pkey = OpenSSL::PKey::RSA.new(File.open("server.key").read)
cert = OpenSSL::X509::Certificate.new(File.open("server.crt").read)
end
class Simple < WEBrick::HTTPServlet::AbstractServlet
def do_ACE(request, response)
puts "ACE request !"
puts request.body
pp request
#status, content_type, body = do_stuff_with(request)
#response.status = status
#response['Content-Type'] = content_type
response.body = "Blah"
end
end
server = WEBrick::HTTPServer.new(
:Port => 443,
:Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
:DocumentRoot => "/ruby/htdocs",
:SSLEnable => true,
:SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,
:SSLCertificate => cert,
:SSLPrivateKey => pkey
#:SSLCertName => [ [ "CN",WEBrick::Utils::getservername ] ]
)
server.mount "/ace", Simple
server.start
Jump to Line
Something went wrong with that request. Please try again.