diff options
Diffstat (limited to 'lib/webrick/https.rb')
-rw-r--r-- | lib/webrick/https.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/webrick/https.rb b/lib/webrick/https.rb index 1494973e74..4826654d3a 100644 --- a/lib/webrick/https.rb +++ b/lib/webrick/https.rb @@ -131,5 +131,22 @@ module WEBrick server = lookup_server(req) server ? server.ssl_context : nil end + + # :stopdoc: + + ## + # Check whether +server+ is also SSL server. + # Also +server+'s SSL context will be created. + + alias orig_virtual_host virtual_host + + def virtual_host(server) + if @config[:SSLEnable] && !server.ssl_context + raise ArgumentError, "virtual host must set SSLEnable to true" + end + orig_virtual_host(server) + end + + # :startdoc: end end |