[#82311] [Ruby trunk Bug#13794] Infinite loop of sched_yield — charlie@...
Issue #13794 has been reported by catphish (Charlie Smurthwaite).
4 messages
2017/08/09
[#82518] [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid — mame@...
Issue #13618 has been updated by mame (Yusuke Endoh).
5 messages
2017/08/30
[#82552] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wong <normalperson@...>
2017/08/31
mame@ruby-lang.org wrote:
[#82756] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid
— Eric Wrong <normalperson@...>
2017/09/12
Eric Wrong <normalperson@yhbt.net> wrote:
[ruby-core:82297] [Ruby trunk Bug#13429] Net::SMTP has no read timeout when connexion over TLS
From:
usa@...
Date:
2017-08-09 08:19:37 UTC
List:
ruby-core #82297
Issue #13429 has been updated by usa (Usaku NAKAMURA).
Backport changed from 2.2: UNKNOWN, 2.3: REQUIRED, 2.4: DONE to 2.2: UNKNOWN, 2.3: DONE, 2.4: DONE
ruby_2_3 r59533 merged revision(s) 56576,56623.
----------------------------------------
Bug #13429: Net::SMTP has no read timeout when connexion over TLS
https://bugs.ruby-lang.org/issues/13429#change-66087
* Author: keysen (J辿r辿my Carlier)
* Status: Closed
* Priority: Normal
* Assignee: usa (Usaku NAKAMURA)
* Target version:
* ruby -v: 2.3.1
* Backport: 2.2: UNKNOWN, 2.3: DONE, 2.4: DONE
----------------------------------------
Hello,
When connecting using TLS to an unresponsive SMTP server, Net::SMTP can hang until 10 minutes.
The issue is here, we should have a read timeout:
``` ruby
def tlsconnect(s)
verified = false
s = ssl_socket(s, @ssl_context)
logging "TLS connection started"
s.sync_close = true
s.connect
if @ssl_context.verify_mode != OpenSSL::SSL::VERIFY_NONE
s.post_connection_check(@address)
end
verified = true
s
ensure
s.close unless verified
end
```
To workaround the issue for the moment I used:
``` ruby
module Net
class SMTP
alias :original_tlsconnect :tlsconnect
def tlsconnect(s)
Timeout.timeout(@read_timeout, Net::ReadTimeout) { original_tlsconnect(s) }
end
end
end
```
Here the steps to reproduce the bug:
``` ruby
smtp = Net::SMTP.new('mail.example.com', 465)
smtp.read_timeout = 3
smtp.enable_tls
smtp.start('localhost.localdomain', 'medecins@example.com', '********') {}
```
Sorry for the credentials I can't provide this publicly, after testing with one failing server you will be able to see that the read timeout is ignored.
By failing server I mean an SMTPS server where you are able to open a connection but you can't read on the socket.
Working case:
``` ruby
smtp = Net::SMTP.new('mail.example.com', 465)
smtp.read_timeout = 3
smtp.start('localhost.localdomain', 'medecins@example.com', '********') {}
```
Without TLS it's ok!
If you have any questions, suggestions just ask, if I can help.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>