From 4bded50f0ddab6913f9c1c74d0173d21633c3a46 Mon Sep 17 00:00:00 2001 From: naruse Date: Tue, 30 Nov 2010 08:06:19 +0000 Subject: * lib/net/http.rb: improve rdoc. patched by Eric Hodel ref #4100 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++++ lib/net/http.rb | 75 +++++++++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 70 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b05101988..f0b695ab2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Nov 30 16:23:23 2010 NARUSE, Yui + + * lib/net/http.rb: improve rdoc. + patched by Eric Hodel ref #4100 + Tue Nov 30 12:23:52 2010 NAKAMURA Usaku * win32/win32.c (rb_w32_read): read only 1 byte at once on console. diff --git a/lib/net/http.rb b/lib/net/http.rb index 0a3ce5b35b..79c1280c23 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -659,9 +659,49 @@ module Net #:nodoc: ssl_version key cert ca_file ca_path cert_store ciphers verify_mode verify_callback verify_depth ssl_timeout ) - attr_accessor(*SSL_ATTRIBUTES) - # return the X.509 certificates the server presented. + # Sets path of a CA certification file in PEM format. + # + # The file can contain several CA certificates. + attr_accessor :ca_file + + # Sets path of a CA certification directory containing certifications in + # PEM format. + attr_accessor :ca_path + + # Sets an OpenSSL::X509::Certificate object as client certificate. + # (This method is appeared in Michal Rokos's OpenSSL extension). + attr_accessor :cert + + # Sets the X509::Store to verify peer certificate. + attr_accessor :cert_store + + # Sets the available ciphers. See OpenSSL::SSL::SSLContext#ciphers= + attr_accessor :ciphers + + # Sets an OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object. + # (This method is appeared in Michal Rokos's OpenSSL extension.) + attr_accessor :key + + # Sets the SSL timeout seconds. + attr_accessor :ssl_timeout + + # Sets the SSL version. See OpenSSL::SSL::SSLContext#ssl_version= + attr_accessor :ssl_version + + # Sets the verify callback for the server certification verification. + attr_accessor :verify_callback + + # Sets the maximum depth for the certificate chain verification. + attr_accessor :verify_depth + + # Sets the flags for server the certification verification at beginning of + # SSL/TLS session. + # + # OpenSSL::SSL::VERIFY_NONE or OpenSSL::SSL::VERIFY_PEER are acceptable. + attr_accessor :verify_mode + + # Returns the X.509 certificates the server presented. def peer_cert if not use_ssl? or not @socket return nil @@ -785,13 +825,28 @@ module Net #:nodoc: # # If +p_addr+ is nil, this method returns self (a Net::HTTP object). # - # # Example - # proxy_class = Net::HTTP::Proxy('proxy.example.com', 8080) - # : - # proxy_class.start('www.ruby-lang.org') {|http| - # # connecting proxy.foo.org:8080 - # : - # } + # # Example + # proxy_class = Net::HTTP::Proxy('proxy.example.com', 8080) + # + # proxy_class.start('www.ruby-lang.org') {|http| + # # connecting proxy.foo.org:8080 + # } + # + # You may use them to work with authorization-enabled proxies: + # + # proxy_host = 'your.proxy.example' + # proxy_port = 8080 + # proxy_user = 'user' + # proxy_pass = 'pass' + # + # proxy = Net::HTTP::Proxy(proxy_host, proxy_port, proxy_user, proxy_pass) + # proxy.start('www.example.com') { |http| + # # always connect to your.proxy.example:8080 using specified username + # # and password + # } + # + # Note that net/http does not use the HTTP_PROXY environment variable. + # If you want to use a proxy, you must set it explicitly. # def HTTP.Proxy(p_addr, p_port = nil, p_user = nil, p_pass = nil) return self unless p_addr @@ -2116,7 +2171,7 @@ module Net #:nodoc: # xxx HTTPUnknownResponse # class HTTPResponse - # true if the response has body. + # true if the response has a body. def HTTPResponse.body_permitted? self::HAS_BODY end -- cgit v1.2.3