I was looking at the code here: How to make Sinatra work over HTTPS/SSL?
require 'sinatra/base'
require 'webrick'
require 'webrick/https'
require 'openssl'
CERT_PATH = '/opt/myCA/server/'
webrick_options = {
:Port => 8443,
:Logger => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
:DocumentRoot => "/ruby/htdocs",
:SSLEnable => true,
:SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE,
:SSLCertificate => OpenSSL::X509::Certificate.new( File.open(File.join(CERT_PATH, "my-server.crt")).read),
:SSLPrivateKey => OpenSSL::PKey::RSA.new( File.open(File.join(CERT_PATH, "my-server.key")).read),
:SSLCertName => [ [ "CN",WEBrick::Utils::getservername ] ]
}
class MyServer < Sinatra::Base
post '/' do
"Hellow, world!"
end
end
Rack::Handler::WEBrick.run MyServer, webrick_options
How does one disable SSLv2, SSLv3 and TLS1.0, and only allow TLS1.2? This will remediate the POODLE vulnerability in older protocols. This is the first time I am experimenting with ruby/WEBrick so pretty novice here. Thanks for any help!