OXIESEC PANEL
- Current Dir:
/
/
usr
/
lib
/
ruby
/
2.5.0
/
webrick
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
accesslog.rb
4.34 KB
12/16/2015 05:07:31 AM
rw-r--r--
📄
cgi.rb
8.06 KB
03/28/2018 12:50:56 PM
rw-r--r--
📄
compat.rb
943 bytes
12/16/2015 05:07:31 AM
rw-r--r--
📄
config.rb
5.69 KB
12/07/2016 12:59:48 PM
rw-r--r--
📄
cookie.rb
3.91 KB
09/27/2016 03:17:47 AM
rw-r--r--
📄
htmlutils.rb
711 bytes
12/16/2015 05:07:31 AM
rw-r--r--
📁
httpauth
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
httpauth.rb
3.36 KB
12/16/2015 05:07:31 AM
rw-r--r--
📄
httpproxy.rb
9.6 KB
03/28/2018 04:44:33 PM
rw-r--r--
📄
httprequest.rb
14.89 KB
05/15/2023 11:41:43 AM
rw-r--r--
📄
httpresponse.rb
11.8 KB
05/15/2023 11:41:43 AM
rw-r--r--
📄
https.rb
3.07 KB
07/18/2017 01:59:28 AM
rw-r--r--
📄
httpserver.rb
7.75 KB
12/13/2017 12:38:08 AM
rw-r--r--
📁
httpservlet
-
05/09/2024 07:14:11 AM
rwxr-xr-x
📄
httpservlet.rb
700 bytes
12/16/2015 05:07:31 AM
rw-r--r--
📄
httpstatus.rb
5.24 KB
09/14/2017 11:16:23 AM
rw-r--r--
📄
httputils.rb
12.91 KB
12/22/2017 01:08:05 AM
rw-r--r--
📄
httpversion.rb
1.6 KB
12/16/2015 05:07:31 AM
rw-r--r--
📄
log.rb
3.99 KB
12/22/2017 01:07:55 AM
rw-r--r--
📄
server.rb
10.04 KB
12/12/2017 11:56:25 AM
rw-r--r--
📄
ssl.rb
7.27 KB
07/18/2017 01:59:28 AM
rw-r--r--
📄
utils.rb
6.94 KB
12/12/2017 11:56:25 AM
rw-r--r--
📄
version.rb
415 bytes
12/24/2017 08:38:43 AM
rw-r--r--
Editing: https.rb
Close
# frozen_string_literal: false # # https.rb -- SSL/TLS enhancement for HTTPServer # # Author: IPR -- Internet Programming with Ruby -- writers # Copyright (c) 2001 GOTOU Yuuzou # Copyright (c) 2002 Internet Programming with Ruby writers. All rights # reserved. # # $IPR: https.rb,v 1.15 2003/07/22 19:20:42 gotoyuzo Exp $ require 'webrick/ssl' require 'webrick/httpserver' module WEBrick module Config HTTP.update(SSL) end ## #-- # Adds SSL functionality to WEBrick::HTTPRequest class HTTPRequest ## # HTTP request SSL cipher attr_reader :cipher ## # HTTP request server certificate attr_reader :server_cert ## # HTTP request client certificate attr_reader :client_cert # :stopdoc: alias orig_parse parse def parse(socket=nil) if socket.respond_to?(:cert) @server_cert = socket.cert || @config[:SSLCertificate] @client_cert = socket.peer_cert @client_cert_chain = socket.peer_cert_chain @cipher = socket.cipher end orig_parse(socket) end alias orig_parse_uri parse_uri def parse_uri(str, scheme="https") if server_cert return orig_parse_uri(str, scheme) end return orig_parse_uri(str) end private :parse_uri alias orig_meta_vars meta_vars def meta_vars meta = orig_meta_vars if server_cert meta["HTTPS"] = "on" meta["SSL_SERVER_CERT"] = @server_cert.to_pem meta["SSL_CLIENT_CERT"] = @client_cert ? @client_cert.to_pem : "" if @client_cert_chain @client_cert_chain.each_with_index{|cert, i| meta["SSL_CLIENT_CERT_CHAIN_#{i}"] = cert.to_pem } end meta["SSL_CIPHER"] = @cipher[0] meta["SSL_PROTOCOL"] = @cipher[1] meta["SSL_CIPHER_USEKEYSIZE"] = @cipher[2].to_s meta["SSL_CIPHER_ALGKEYSIZE"] = @cipher[3].to_s end meta end # :startdoc: end ## #-- # Fake WEBrick::HTTPRequest for lookup_server class SNIRequest ## # The SNI hostname attr_reader :host ## # The socket address of the server attr_reader :addr ## # The port this request is for attr_reader :port ## # Creates a new SNIRequest. def initialize(sslsocket, hostname) @host = hostname @addr = sslsocket.addr @port = @addr[1] end end ## #-- # Adds SSL functionality to WEBrick::HTTPServer class HTTPServer < ::WEBrick::GenericServer ## # ServerNameIndication callback def ssl_servername_callback(sslsocket, hostname = nil) req = SNIRequest.new(sslsocket, hostname) 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