GIF87a;
# # 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' 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 end
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
httpauth | Folder | 0755 |
|
|
httpservlet | Folder | 0755 |
|
|
accesslog.rb | File | 4.31 KB | 0644 |
|
cgi.rb | File | 7.97 KB | 0644 |
|
compat.rb | File | 912 B | 0644 |
|
config.rb | File | 5.56 KB | 0644 |
|
cookie.rb | File | 3.88 KB | 0644 |
|
htmlutils.rb | File | 680 B | 0644 |
|
httpauth.rb | File | 3.33 KB | 0644 |
|
httpproxy.rb | File | 9.65 KB | 0644 |
|
httprequest.rb | File | 14.7 KB | 0644 |
|
httpresponse.rb | File | 11 KB | 0644 |
|
https.rb | File | 1.87 KB | 0644 |
|
httpserver.rb | File | 7.69 KB | 0644 |
|
httpservlet.rb | File | 669 B | 0644 |
|
httpstatus.rb | File | 5.13 KB | 0644 |
|
httputils.rb | File | 12.71 KB | 0644 |
|
httpversion.rb | File | 1.57 KB | 0644 |
|
log.rb | File | 3.96 KB | 0644 |
|
server.rb | File | 8.42 KB | 0644 |
|
ssl.rb | File | 6.67 KB | 0644 |
|
utils.rb | File | 6.44 KB | 0644 |
|
version.rb | File | 384 B | 0644 |
|