You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python SSL module does not clear error queue before IO operations using SSL_get_error #81891
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/tiran'closed_at=Nonecreated_at=<Date2019-07-29.21:17:25.102>labels= ['expert-SSL', '3.7', '3.8', '3.9']
title='Python SSL module does not clear error queue before IO operations using SSL_get_error'updated_at=<Date2019-07-29.21:17:25.102>user='https://github.com/apc-cradlepoint'
Modules/_ssl.c does clear errors on socket creation, and upon handling an error itself, but does not clear before IO operations that are checked with SSL_get_error.
When using OpenSSL outside of Modules/_ssl.c in the same process context (for example, using libssh through python bindings), this can results in random ssl errors being picked up by Modules/_ssl.c.
Activity
apc-cradlepoint commentedon Jul 29, 2019
Per the OpenSSL documentation:
"The current thread's error queue must be empty before the TLS/SSL I/O operation is attempted, or SSL_get_error() will not work reliably."
https://www.openssl.org/docs/man1.1.1/man3/SSL_get_error.html
Modules/_ssl.c does clear errors on socket creation, and upon handling an error itself, but does not clear before IO operations that are checked with SSL_get_error.
When using OpenSSL outside of Modules/_ssl.c in the same process context (for example, using libssh through python bindings), this can results in random ssl errors being picked up by Modules/_ssl.c.