diff options
author | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2002-07-23 20:23:30 +0000 |
---|---|---|
committer | GOTOU Yuuzou <gotoyuzo@notwork.org> | 2002-07-23 20:23:30 +0000 |
commit | 9b24749550879e2ab37be4ceb799c583e0bfee84 (patch) | |
tree | bded8e835aa0ee087c1f2965a8476db896c01293 /lib/net/https.rb | |
parent | 1527429c5b8964ba0e38b33c916b747b5ba12ce7 (diff) | |
download | ruby-openssl-history-9b24749550879e2ab37be4ceb799c583e0bfee84.tar.gz |
* follow net/http.rb Rev: 1.41.2.18 (ruby_1_6)
Diffstat (limited to 'lib/net/https.rb')
-rw-r--r-- | lib/net/https.rb | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/lib/net/https.rb b/lib/net/https.rb index 8ea304b..727a12c 100644 --- a/lib/net/https.rb +++ b/lib/net/https.rb @@ -2,7 +2,7 @@ = https.rb -- SSL/TLS enhancement for Net::HTTP. - Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org> + Copyright (C) 2001 GOTOU Yuuzou <gotoyuzo@notwork.org> This program requires Net 1.2.0 or higher version. You can get it from RAA or Ruby's CVS repository. @@ -104,32 +104,13 @@ module Net attr_writer :verify_mode, :verify_callback, :verify_depth attr_reader :peer_cert - class Conn < ::Net::NetPrivate::HTTPRequest - REQUEST_HAS_BODY=false - RESPONSE_HAS_BODY=false - METHOD="connect" - - def initialize - super nil, nil - end - - def exec( sock, addr, port, ver ) - @socket = sock - request addr, port, ver - @response = get_response(sock) - @response - end - - def request( addr, port, ver ) - @socket.writeline sprintf('CONNECT %s:%s HTTP/%s', addr, port, ver) - @socket.writeline '' - end - end - def on_connect if use_ssl if proxy? - resp = Conn.new.exec(@socket, @address, @port, "1.0") + @socket.writeline( + sprintf('CONNECT %s:%s HTTP/%s', @address, @port, "1.0")) + @socket.writeline '' + resp = HTTPResponse.read_new(@socket, nil) if resp.code != '200' raise resp.message end |