Message389807
Based on your first comment, poll returning an event and recv not able to read data is a behavior to expect with TLSv1.2/TLSv1.3 (or ...)
So in order to use SSLContext in a polling loop with multiple file descriptors, a non-blocking mode (to avoid an fd event and not being able to read data) is mandatory. Do you agree with this statement ?
Furthermore, I looked at [1], the other tests in test_ssl.py and also set a few traces in _ssl.c
- without non blocking mode: even with a fd event, the test blocks on SSL_read
- with non blocking mode: SSL_read returns a negative value, PySSL_SetError throws PySSLWantWriteErrorObject, but:
nothing is printed on the console, a thread is blocked at PyThread_acquire_lock_timed, so the test hangs forever.
- with non blocking mode + try/except ssl.SSLWantReadError [2], the test is ok
[1] https://docs.python.org/3/library/ssl.html#ssl-nonblocking
[2] https://github.com/g-chauvel/cpython/commit/dc57cbea3558ff7b3c040326709d9b759214584a |
|
Date |
User |
Action |
Args |
2021-03-30 08:40:23 | gchauvel | set | recipients:
+ gchauvel, christian.heimes |
2021-03-30 08:40:23 | gchauvel | set | messageid: <1617093623.29.0.705847641545.issue43622@roundup.psfhosted.org> |
2021-03-30 08:40:23 | gchauvel | link | issue43622 messages |
2021-03-30 08:40:22 | gchauvel | create | |
|