]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-113214: Fix SSLProto exception handling in SSL-over-SSL scenarios (#113334)
authorMartijn Pieters <mj@zopatista.com>
Wed, 20 Dec 2023 23:09:01 +0000 (23:09 +0000)
committerGitHub <noreply@github.com>
Wed, 20 Dec 2023 23:09:01 +0000 (15:09 -0800)
commit1ff02385944924db7e683a607da2882462594764
tree05a658fb019bc290359c9c3aee69116decdd8f91
parenta3e8afe0a3b5868440501edf579d1d4711c0fb18
GH-113214: Fix SSLProto exception handling in SSL-over-SSL scenarios (#113334)

When wrapped, `_SSLProtocolTransport._force_close(exc)` is called just like in the unwrapped scenario `_SelectorTransport._force_close(exc)` or `_ProactorBasePipeTransport._force_close(exc)` would be called, except here the exception needs to be passed through the `SSLProtocol._abort()` method, which didn't accept an exception object.

This commit ensures that this path works, in the same way that the uvloop implementation of SSLProto passes on the exception (on which the current implementation of SSLProto is based).
Lib/asyncio/sslproto.py
Lib/test/test_asyncio/test_sslproto.py
Misc/NEWS.d/next/Library/2023-12-20-21-18-51.gh-issue-113214.JcV9Mn.rst [new file with mode: 0644]