mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
[3.11] gh-109534: fix reference leak when SSL handshake fails (GH-114074) (#114830)
gh-109534: fix reference leak when SSL handshake fails (GH-114074)
(cherry picked from commit 80aa7b3688
)
Co-authored-by: Jamie Phan <jamie@ordinarylab.dev>
This commit is contained in:
parent
fe0f544f33
commit
ef2ba9a007
3 changed files with 8 additions and 0 deletions
|
@ -579,6 +579,7 @@ class SSLProtocol(protocols.BufferedProtocol):
|
|||
|
||||
peercert = sslobj.getpeercert()
|
||||
except Exception as exc:
|
||||
handshake_exc = None
|
||||
self._set_state(SSLProtocolState.UNWRAPPED)
|
||||
if isinstance(exc, ssl.CertificateError):
|
||||
msg = 'SSL handshake failed on verifying the certificate'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue