[issue8222] enabling SSL_ERROR_WANT_READ on SSL sockets
Antoine Pitrou
report at bugs.python.org
Wed Mar 24 17:33:21 CET 2010
New submission from Antoine Pitrou <pitrou at free.fr>:
In light of the recv() and recv_into() implementation change (issue3890), I think we should enable SSL_MODE_AUTO_RETRY for SSL sockets. It prevents blocking read() calls from getting SSL_ERROR_WANT_READ at all.
(previously, we would loop manually in recv() and recv_into(); letting
the C OpenSSL runtime do it for us is certainly more efficient)
See description in
http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html:
« SSL_MODE_AUTO_RETRY
Never bother the application with retries if the transport is
blocking. If a renegotiation take place during normal operation,
a SSL_read(3) or SSL_write(3) would return with -1 and indicate
the need to retry with SSL_ERROR_WANT_READ. In a non-blocking
environment applications must be prepared to handle incomplete
read/write operations. In a blocking environment, applications
are not always prepared to deal with read/write operations
returning without success report. The flag SSL_MODE_AUTO_RETRY
will cause read/write operations to only return after the
handshake and successful completion. »
----------
components: Library (Lib)
messages: 101640
nosy: giampaolo.rodola, janssen, pitrou
priority: normal
severity: normal
status: open
title: enabling SSL_ERROR_WANT_READ on SSL sockets
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8222>
_______________________________________
More information about the Python-bugs-list
mailing list