summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio/sslproto.py
diff options
context:
space:
mode:
authorJamie Phan <jamie@ordinarylab.dev>2024-02-01 00:42:17 (GMT)
committerGitHub <noreply@github.com>2024-02-01 00:42:17 (GMT)
commit80aa7b3688b8fdc85cd53d4113cb5f6ce5500027 (patch)
tree721ee4d9118e062dce9c1e682d5c5ff3d1fe28bc /Lib/asyncio/sslproto.py
parent7b9d406729e7e7adc482b5b8c920de1874c234d0 (diff)
downloadcpython-80aa7b3688b8fdc85cd53d4113cb5f6ce5500027.zip
cpython-80aa7b3688b8fdc85cd53d4113cb5f6ce5500027.tar.gz
cpython-80aa7b3688b8fdc85cd53d4113cb5f6ce5500027.tar.bz2
gh-109534: fix reference leak when SSL handshake fails (#114074)
Diffstat (limited to 'Lib/asyncio/sslproto.py')
-rw-r--r--Lib/asyncio/sslproto.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/asyncio/sslproto.py b/Lib/asyncio/sslproto.py
index 599e91b..fa99d45 100644
--- a/Lib/asyncio/sslproto.py
+++ b/Lib/asyncio/sslproto.py
@@ -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'