[New-bugs-announce] [issue30562] SSL socket does not respect SO_RCVTIME0 timeouts

Allan Crooks report at bugs.python.org
Sat Jun 3 17:15:42 EDT 2017


New submission from Allan Crooks:

I initially filed this ticket against the ldap3 library, as this is where I first encountered the issue: https://github.com/cannatag/ldap3/issues/356

I've attached a file which reproduces the issue using the standard library - it makes both a HTTP and HTTPS request to a link that should return a HTTP response after 10 seconds, but we set the socket option SO_RCVTIMEO to 2 seconds. This should result in a read timeout while waiting for a response.

On my 64 bit Ubuntu 16.04 machine, the HTTP connection times out as expected, but the HTTPS connection doesn't time out at all (and so ends up reading the HTTP response).

It doesn't seem to be an issue specific to HTTPS - I ran into the original issue while using TLS for an LDAP connection using the ldap3 library. If you follow the comments in the ticket, a connection with SO_RCVTIMEO set to 3 seconds ended up taking 1076 seconds to timeout, while on an OSX machine, it took 148 seconds to timeout. On a Windows machine, it seems to work just fine (it timed out after the desired 3 seconds).

Is this option fully supported for SSL sockets?

----------
assignee: christian.heimes
components: SSL
files: httpdelay.py
messages: 295106
nosy: allanc, christian.heimes
priority: normal
severity: normal
status: open
title: SSL socket does not respect SO_RCVTIME0 timeouts
type: behavior
versions: Python 2.7, Python 3.5
Added file: http://bugs.python.org/file46922/httpdelay.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30562>
_______________________________________


More information about the New-bugs-announce mailing list