ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:55736] [ruby-trunk - Bug #8590][Open] Second call of https.get results in timeout
@ 2013-07-01 12:07 yhara (Yutaka HARA)
  2013-07-10  4:39 ` [ruby-core:55903] [ruby-trunk - Bug #8590][Assigned] " zzak (Zachary Scott)
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: yhara (Yutaka HARA) @ 2013-07-01 12:07 UTC (permalink / raw)
  To: ruby-core


Issue #8590 has been reported by yhara (Yutaka HARA).

----------------------------------------
Bug #8590: Second call of https.get results in timeout
https://bugs.ruby-lang.org/issues/8590

Author: yhara (Yutaka HARA)
Status: Open
Priority: Normal
Assignee: 
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


Hi,

In the following code, second call of https.get results in an error "Connection reset by peer - SSL_connect" after timeout.

---
require "net/https"
https = Net::HTTP.new("secure.nicovideo.jp", 443)
#https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server

https.use_ssl = true
https.ssl_version = 'TLSv1' 
https.start{ p https.get('/') }  #=> OK
https.start{ p https.get('/') }  #=> (Timeout)
---

Expected: prints response twice

Actual: prints response once, and raises the following error after timeout

/Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'

Is this a bug of Net::HTTP, or a problem of the server, or just I'm doing something wrong?

Thanks in advance.


-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:55903] [ruby-trunk - Bug #8590][Assigned] Second call of https.get results in timeout
  2013-07-01 12:07 [ruby-core:55736] [ruby-trunk - Bug #8590][Open] Second call of https.get results in timeout yhara (Yutaka HARA)
@ 2013-07-10  4:39 ` zzak (Zachary Scott)
  2013-07-10  8:10 ` [ruby-core:55910] [ruby-trunk - Bug #8590] " Glass_saga (Masaki Matsushita)
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: zzak (Zachary Scott) @ 2013-07-10  4:39 UTC (permalink / raw)
  To: ruby-core


Issue #8590 has been updated by zzak (Zachary Scott).

Status changed from Open to Assigned
Assignee set to naruse (Yui NARUSE)


----------------------------------------
Bug #8590: Second call of https.get results in timeout
https://bugs.ruby-lang.org/issues/8590#change-40404

Author: yhara (Yutaka HARA)
Status: Assigned
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


Hi,

In the following code, second call of https.get results in an error "Connection reset by peer - SSL_connect" after timeout.

---
require "net/https"
https = Net::HTTP.new("secure.nicovideo.jp", 443)
#https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server

https.use_ssl = true
https.ssl_version = 'TLSv1' 
https.start{ p https.get('/') }  #=> OK
https.start{ p https.get('/') }  #=> (Timeout)
---

Expected: prints response twice

Actual: prints response once, and raises the following error after timeout

/Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'

Is this a bug of Net::HTTP, or a problem of the server, or just I'm doing something wrong?

Thanks in advance.


-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:55910] [ruby-trunk - Bug #8590] Second call of https.get results in timeout
  2013-07-01 12:07 [ruby-core:55736] [ruby-trunk - Bug #8590][Open] Second call of https.get results in timeout yhara (Yutaka HARA)
  2013-07-10  4:39 ` [ruby-core:55903] [ruby-trunk - Bug #8590][Assigned] " zzak (Zachary Scott)
@ 2013-07-10  8:10 ` Glass_saga (Masaki Matsushita)
  2013-07-10  8:34 ` [ruby-core:55912] [ruby-trunk - Bug #8590][Feedback] " naruse (Yui NARUSE)
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Glass_saga (Masaki Matsushita) @ 2013-07-10  8:10 UTC (permalink / raw)
  To: ruby-core


Issue #8590 has been updated by Glass_saga (Masaki Matsushita).


It can be reproduced on trunk r41889.
----------------------------------------
Bug #8590: Second call of https.get results in timeout
https://bugs.ruby-lang.org/issues/8590#change-40410

Author: yhara (Yutaka HARA)
Status: Assigned
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


Hi,

In the following code, second call of https.get results in an error "Connection reset by peer - SSL_connect" after timeout.

---
require "net/https"
https = Net::HTTP.new("secure.nicovideo.jp", 443)
#https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server

https.use_ssl = true
https.ssl_version = 'TLSv1' 
https.start{ p https.get('/') }  #=> OK
https.start{ p https.get('/') }  #=> (Timeout)
---

Expected: prints response twice

Actual: prints response once, and raises the following error after timeout

/Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'

Is this a bug of Net::HTTP, or a problem of the server, or just I'm doing something wrong?

Thanks in advance.


-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:55912] [ruby-trunk - Bug #8590][Feedback] Second call of https.get results in timeout
  2013-07-01 12:07 [ruby-core:55736] [ruby-trunk - Bug #8590][Open] Second call of https.get results in timeout yhara (Yutaka HARA)
  2013-07-10  4:39 ` [ruby-core:55903] [ruby-trunk - Bug #8590][Assigned] " zzak (Zachary Scott)
  2013-07-10  8:10 ` [ruby-core:55910] [ruby-trunk - Bug #8590] " Glass_saga (Masaki Matsushita)
@ 2013-07-10  8:34 ` naruse (Yui NARUSE)
  2013-07-10 23:51 ` [ruby-core:55938] [ruby-trunk - Bug #8590] " drbrain (Eric Hodel)
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: naruse (Yui NARUSE) @ 2013-07-10  8:34 UTC (permalink / raw)
  To: ruby-core


Issue #8590 has been updated by naruse (Yui NARUSE).

Status changed from Assigned to Feedback

I can't reproduce on
* ruby 2.1.0dev (2013-07-10 trunk 41892) [x86_64-freebsd9.1]
* OpenSSL 0.9.8y 5 Feb 2013

Feedback and patch is welcome
----------------------------------------
Bug #8590: Second call of https.get results in timeout
https://bugs.ruby-lang.org/issues/8590#change-40411

Author: yhara (Yutaka HARA)
Status: Feedback
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


Hi,

In the following code, second call of https.get results in an error "Connection reset by peer - SSL_connect" after timeout.

---
require "net/https"
https = Net::HTTP.new("secure.nicovideo.jp", 443)
#https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server

https.use_ssl = true
https.ssl_version = 'TLSv1' 
https.start{ p https.get('/') }  #=> OK
https.start{ p https.get('/') }  #=> (Timeout)
---

Expected: prints response twice

Actual: prints response once, and raises the following error after timeout

/Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'

Is this a bug of Net::HTTP, or a problem of the server, or just I'm doing something wrong?

Thanks in advance.


-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:55938] [ruby-trunk - Bug #8590] Second call of https.get results in timeout
  2013-07-01 12:07 [ruby-core:55736] [ruby-trunk - Bug #8590][Open] Second call of https.get results in timeout yhara (Yutaka HARA)
                   ` (2 preceding siblings ...)
  2013-07-10  8:34 ` [ruby-core:55912] [ruby-trunk - Bug #8590][Feedback] " naruse (Yui NARUSE)
@ 2013-07-10 23:51 ` drbrain (Eric Hodel)
  2013-07-11  8:51 ` [ruby-core:55945] " naruse (Yui NARUSE)
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: drbrain (Eric Hodel) @ 2013-07-10 23:51 UTC (permalink / raw)
  To: ruby-core


Issue #8590 has been updated by drbrain (Eric Hodel).

File net.http.reuse_ssl_session.patch added

=begin
I can reproduce it with OpenSSL 1.0.1e 11 Feb 2013 and ruby trunk, it seems related to SSL session reuse.

(({openssl s_client})) for 1.0.1e behaves strangely, with this server, however. (({openssl s_client -host secure.nicovideo.jp -port 443})) times out, (({openssl s_client -host secure.nicovideo.jp -port 443 -tls1})) connects successfully.  Adding the (({-reconnect})) flag does not produce the timeout for subsequent connections.

With the attached patch the following test.rb attaches successfully twice:

  require "net/https"
  https = Net::HTTP.new("secure.nicovideo.jp", 443)
  #https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server
  
  https.open_timeout = 5
  
  https.use_ssl = true
  https.reuse_ssl_session = false
  https.ssl_version = 'TLSv1'
  https.start{ p https.get('/') }  #=> OK
  https.start{ p https.get('/') }  #=> (Timeout)

May I commit?

=end
----------------------------------------
Bug #8590: Second call of https.get results in timeout
https://bugs.ruby-lang.org/issues/8590#change-40433

Author: yhara (Yutaka HARA)
Status: Feedback
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


Hi,

In the following code, second call of https.get results in an error "Connection reset by peer - SSL_connect" after timeout.

---
require "net/https"
https = Net::HTTP.new("secure.nicovideo.jp", 443)
#https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server

https.use_ssl = true
https.ssl_version = 'TLSv1' 
https.start{ p https.get('/') }  #=> OK
https.start{ p https.get('/') }  #=> (Timeout)
---

Expected: prints response twice

Actual: prints response once, and raises the following error after timeout

/Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'

Is this a bug of Net::HTTP, or a problem of the server, or just I'm doing something wrong?

Thanks in advance.


-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:55945] [ruby-trunk - Bug #8590] Second call of https.get results in timeout
  2013-07-01 12:07 [ruby-core:55736] [ruby-trunk - Bug #8590][Open] Second call of https.get results in timeout yhara (Yutaka HARA)
                   ` (3 preceding siblings ...)
  2013-07-10 23:51 ` [ruby-core:55938] [ruby-trunk - Bug #8590] " drbrain (Eric Hodel)
@ 2013-07-11  8:51 ` naruse (Yui NARUSE)
  2014-01-30  6:17 ` [ruby-core:60300] " shibata.hiroshi
  2019-08-15 19:49 ` [ruby-core:94371] [Ruby master Bug#8590] " merch-redmine
  6 siblings, 0 replies; 8+ messages in thread
From: naruse (Yui NARUSE) @ 2013-07-11  8:51 UTC (permalink / raw)
  To: ruby-core


Issue #8590 has been updated by naruse (Yui NARUSE).


drbrain (Eric Hodel) wrote:
> I can reproduce it with OpenSSL 1.0.1e 11 Feb 2013 and ruby trunk, it seems related to SSL session reuse.
> 
> (({openssl s_client})) for 1.0.1e behaves strangely with this server, however. (({openssl s_client -host secure.nicovideo.jp -port 443})) times out, (({openssl s_client -host secure.nicovideo.jp -port 443 -tls1})) connects successfully.  Adding the (({-reconnect})) flag does not produce the timeout for subsequent connections.
> 
> With the attached patch the following test.rb attaches successfully twice:
> 
>   require "net/https"
>   https = Net::HTTP.new("secure.nicovideo.jp", 443)
>   #https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server
>   
>   https.open_timeout = 5
>   
>   https.use_ssl = true
>   https.reuse_ssl_session = false
>   https.ssl_version = 'TLSv1'
>   https.start{ p https.get('/') }  #=> OK
>   https.start{ p https.get('/') }  #=> (Timeout)
> 
> May I commit?

The reuse_ssl_session = false feels workaround; it can't be applied generally.
As far as I understand, this is because SSL-related timeout won't be reconnected though normal HTTP is reconnected automatically.
Therefore https should also reconnect automatically.
----------------------------------------
Bug #8590: Second call of https.get results in timeout
https://bugs.ruby-lang.org/issues/8590#change-40442

Author: yhara (Yutaka HARA)
Status: Feedback
Priority: Normal
Assignee: naruse (Yui NARUSE)
Category: lib
Target version: current: 2.1.0
ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


Hi,

In the following code, second call of https.get results in an error "Connection reset by peer - SSL_connect" after timeout.

---
require "net/https"
https = Net::HTTP.new("secure.nicovideo.jp", 443)
#https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server

https.use_ssl = true
https.ssl_version = 'TLSv1' 
https.start{ p https.get('/') }  #=> OK
https.start{ p https.get('/') }  #=> (Timeout)
---

Expected: prints response twice

Actual: prints response once, and raises the following error after timeout

/Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'

Is this a bug of Net::HTTP, or a problem of the server, or just I'm doing something wrong?

Thanks in advance.


-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:60300] [ruby-trunk - Bug #8590] Second call of https.get results in timeout
  2013-07-01 12:07 [ruby-core:55736] [ruby-trunk - Bug #8590][Open] Second call of https.get results in timeout yhara (Yutaka HARA)
                   ` (4 preceding siblings ...)
  2013-07-11  8:51 ` [ruby-core:55945] " naruse (Yui NARUSE)
@ 2014-01-30  6:17 ` shibata.hiroshi
  2019-08-15 19:49 ` [ruby-core:94371] [Ruby master Bug#8590] " merch-redmine
  6 siblings, 0 replies; 8+ messages in thread
From: shibata.hiroshi @ 2014-01-30  6:17 UTC (permalink / raw)
  To: ruby-core

Issue #8590 has been updated by Hiroshi SHIBATA.

Target version changed from 2.1.0 to current: 2.2.0

----------------------------------------
Bug #8590: Second call of https.get results in timeout
https://bugs.ruby-lang.org/issues/8590#change-44785

* Author: Yutaka HARA
* Status: Feedback
* Priority: Normal
* Assignee: Yui NARUSE
* Category: lib
* Target version: current: 2.2.0
* ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
* Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN
----------------------------------------
Hi,

In the following code, second call of https.get results in an error "Connection reset by peer - SSL_connect" after timeout.

---
require "net/https"
https = Net::HTTP.new("secure.nicovideo.jp", 443)
#https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server

https.use_ssl = true
https.ssl_version = 'TLSv1' 
https.start{ p https.get('/') }  #=> OK
https.start{ p https.get('/') }  #=> (Timeout)
---

Expected: prints response twice

Actual: prints response once, and raises the following error after timeout

/Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'

Is this a bug of Net::HTTP, or a problem of the server, or just I'm doing something wrong?

Thanks in advance.

---Files--------------------------------
net.http.reuse_ssl_session.patch (2.62 KB)


-- 
http://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ruby-core:94371] [Ruby master Bug#8590] Second call of https.get results in timeout
  2013-07-01 12:07 [ruby-core:55736] [ruby-trunk - Bug #8590][Open] Second call of https.get results in timeout yhara (Yutaka HARA)
                   ` (5 preceding siblings ...)
  2014-01-30  6:17 ` [ruby-core:60300] " shibata.hiroshi
@ 2019-08-15 19:49 ` merch-redmine
  6 siblings, 0 replies; 8+ messages in thread
From: merch-redmine @ 2019-08-15 19:49 UTC (permalink / raw)
  To: ruby-core

Issue #8590 has been updated by jeremyevans0 (Jeremy Evans).

Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN)
Status changed from Feedback to Closed

I think this was fixed by commit:711ece42cddc4737a4b1667b1f20ca74030d0255.

----------------------------------------
Bug #8590: Second call of https.get results in timeout
https://bugs.ruby-lang.org/issues/8590#change-80785

* Author: yhara (Yutaka HARA)
* Status: Closed
* Priority: Normal
* Assignee: naruse (Yui NARUSE)
* Target version: 
* ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
* Backport: 
----------------------------------------
Hi,

In the following code, second call of https.get results in an error "Connection reset by peer - SSL_connect" after timeout.

---
require "net/https"
https = Net::HTTP.new("secure.nicovideo.jp", 443)
#https = Net::HTTP.new("www.sbisec.co.jp", 443)  # same result for this server

https.use_ssl = true
https.ssl_version = 'TLSv1' 
https.start{ p https.get('/') }  #=> OK
https.start{ p https.get('/') }  #=> (Timeout)
---

Expected: prints response twice

Actual: prints response once, and raises the following error after timeout

/Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect': Connection reset by peer - SSL_connect (Errno::ECONNRESET)
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `block in connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:918:in `connect'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:in `do_start'
        from /Users/yhara/.rbenv/versions/2.0.0-p247/lib/ruby/2.0.0/net/http.rb:851:in `start'

Is this a bug of Net::HTTP, or a problem of the server, or just I'm doing something wrong?

Thanks in advance.

---Files--------------------------------
net.http.reuse_ssl_session.patch (2.62 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-08-15 19:50 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-01 12:07 [ruby-core:55736] [ruby-trunk - Bug #8590][Open] Second call of https.get results in timeout yhara (Yutaka HARA)
2013-07-10  4:39 ` [ruby-core:55903] [ruby-trunk - Bug #8590][Assigned] " zzak (Zachary Scott)
2013-07-10  8:10 ` [ruby-core:55910] [ruby-trunk - Bug #8590] " Glass_saga (Masaki Matsushita)
2013-07-10  8:34 ` [ruby-core:55912] [ruby-trunk - Bug #8590][Feedback] " naruse (Yui NARUSE)
2013-07-10 23:51 ` [ruby-core:55938] [ruby-trunk - Bug #8590] " drbrain (Eric Hodel)
2013-07-11  8:51 ` [ruby-core:55945] " naruse (Yui NARUSE)
2014-01-30  6:17 ` [ruby-core:60300] " shibata.hiroshi
2019-08-15 19:49 ` [ruby-core:94371] [Ruby master Bug#8590] " merch-redmine

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).