From 9ba965c87f53becb5443a499cb144b39aa2bb6fe Mon Sep 17 00:00:00 2001 From: Username Date: Thu, 25 Dec 2025 19:13:47 +0100 Subject: [PATCH] proxywatchd: ensure socket cleanup before SSL fallback --- proxywatchd.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proxywatchd.py b/proxywatchd.py index 5854f0d..1981752 100644 --- a/proxywatchd.py +++ b/proxywatchd.py @@ -1463,6 +1463,11 @@ class TargetTestJob(): return None, proto, duration, torhost, srvname, 0, use_ssl, 'ssl_mitm' elif et == rocksock.RS_ET_SSL and not ssl_only_check: # SSL failed but proxy protocol worked - fallback to HTTP + # sock already disconnected above, but ensure cleanup + try: + sock.disconnect() + except Exception: + pass if config.watchd.debug: _log('SSL failed, fallback to HTTP: %s://%s:%d' % (proto, ps.ip, ps.port), 'debug') try: