Message101753
ssl.SSLSocket.write on non-blocking sockets will fail with:
_ssl.c:1217: error:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry
on a write retry, if the buffer address has changed between the initial call and the retry (when the initial call returned 0 bytes written, which means you should try again later).
From OpenSSL docs (http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html):
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
Make it possible to retry SSL_write() with changed buffer location (the buffer contents must stay the same). This is not the default to avoid the misconception that non-blocking SSL_write() behaves like non-blocking write().
Attached patch fixes the problem (tested on Python 2.6.5, 2.7 trunk) by calling SSL_CTX_set_mode with SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER. It's a single line patch. |
|
Date |
User |
Action |
Args |
2010-03-26 15:30:34 | cbay | set | recipients:
+ cbay |
2010-03-26 15:30:34 | cbay | set | messageid: <1269617434.76.0.650979265578.issue8240@psf.upfronthosting.co.za> |
2010-03-26 15:30:33 | cbay | link | issue8240 messages |
2010-03-26 15:30:33 | cbay | create | |
|