mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-115627: Fix PySSL_SetError handling SSL_ERROR_SYSCALL (GH-115628)
Python 3.10 changed from using SSL_write() and SSL_read() to SSL_write_ex() and SSL_read_ex(), but did not update handling of the return value. Change error handling so that the return value is not examined. OSError (not EOF) is now returned when retval is 0. According to *recent* man pages of all functions for which we call PySSL_SetError, (in OpenSSL 3.0 and 1.1.1), their return value should be used to determine whether an error happened (i.e. if PySSL_SetError should be called), but not what kind of error happened (so, PySSL_SetError shouldn't need retval). To get the error, we need to use SSL_get_error. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Petr Viktorin <encukou@gmail.com>
This commit is contained in:
parent
d52bdfb19f
commit
ea9a296fce
3 changed files with 35 additions and 43 deletions
|
|
@ -0,0 +1,2 @@
|
|||
Fix the :mod:`ssl` module error handling of connection terminate by peer.
|
||||
It now throws an OSError with the appropriate error code instead of an EOFError.
|
||||
Loading…
Add table
Add a link
Reference in a new issue