diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-26 19:59:11 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-26 19:59:11 +0000 |
commit | b6b8cc01a5bd3d72e3824c915fcbb913d82334d8 (patch) | |
tree | 75b485e3e7c22c7dfa8575daddb8c637fe3aeadf /lib | |
parent | e125a38c6648d0b715f192f5340c9e72f6415fd9 (diff) | |
download | ruby-b6b8cc01a5bd3d72e3824c915fcbb913d82334d8.tar.gz |
* lib/net/http.rb (Net::HTTP::SSL_IVNAMES): rerefix 33701.
SSL_ATTRIBUTES stores names for set_params, they are symbol.
SSL_IVNAMES stores instance variable names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33853 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/http.rb | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb index c383f206d3..9867e280e0 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -591,10 +591,8 @@ module Net #:nodoc: @enable_post_connection_check = true @compression = nil @sspi_enabled = false - if defined?(SSL_ATTRIBUTES) - SSL_ATTRIBUTES.each do |name| - instance_variable_set name, nil - end + SSL_IVNAMES.each do |ivname| + instance_variable_set ivname, nil end end @@ -676,7 +674,7 @@ module Net #:nodoc: @use_ssl = flag end - SSL_ATTRIBUTES = [ + SSL_IVNAMES = [ :@ca_file, :@ca_path, :@cert, @@ -689,6 +687,19 @@ module Net #:nodoc: :@verify_depth, :@verify_mode, ] + SSL_ATTRIBUTES = [ + :ca_file, + :ca_path, + :cert, + :cert_store, + :ciphers, + :key, + :ssl_timeout, + :ssl_version, + :verify_callback, + :verify_depth, + :verify_mode, + ] # Sets path of a CA certification file in PEM format. # @@ -775,10 +786,10 @@ module Net #:nodoc: if use_ssl? ssl_parameters = Hash.new iv_list = instance_variables - SSL_ATTRIBUTES.each do |ivname| + SSL_IVNAMES.each_with_index do |ivname, i| if iv_list.include?(ivname) and - value = instance_variable_get(ivname) - ssl_parameters[name] = value + value = instance_variable_get(ivname) + ssl_parameters[SSL_ATTRIBUTES[i]] = value if value end end @ssl_context = OpenSSL::SSL::SSLContext.new |