Project

General

Profile

Bug #1907

ssl_timeout cannot be set in HTTPS request

Added by lsegal (Loren Segal) almost 11 years ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
ruby -v:
ruby 1.9.1p0 (2009-01-30 revision 21907) [i386-darwin9.6.0]
[ruby-core:24812]

Description

=begin
Net::HTTPS defines SSL_ATTRIBUTES which, as I understand, are attributes that can be set on an HTTP object and includes ssl_timeout

However when applying these attributes on the SSLContext, the following exception is raised:

NoMethodError: undefined method ssl_timeout=' for #<OpenSSL::SSL::SSLContext:0x6511fc>
from /usr/local/lib/ruby19/1.9.1/openssl/ssl.rb:39:in
block in set_params'
from /usr/local/lib/ruby19/1.9.1/openssl/ssl.rb:39:in each'
from /usr/local/lib/ruby19/1.9.1/openssl/ssl.rb:39:in
set_params'
from /usr/local/lib/ruby19/1.9.1/net/http.rb:591:in connect'
from /usr/local/lib/ruby19/1.9.1/net/http.rb:574:in
do_start'
from /usr/local/lib/ruby19/1.9.1/net/http.rb:563:in start'
from /usr/local/lib/ruby19/1.9.1/net/http.rb:1094:in
request'
from (irb):16
from /usr/local/bin/irb:12:in `'

The code being run is:

require 'net/https'
http = Net::HTTP.new("example.com")
http.use_ssl = true
http.ssl_timeout = 1
http.request('hi') # exception is raised here

SSLContext does not implement ssl_timeout= but it does have timeout=, so this attribute should be handled specially, or perhaps be aliased in SSLContext?
=end

Also available in: Atom PDF