From 6cef3d688fe4df7e350dda60e6d9dccf81ab327d Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Sat, 17 Feb 2024 19:50:36 +0900 Subject: [PATCH] Rollback server.py --- server.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/server.py b/server.py index b52d0ed..7b5a895 100644 --- a/server.py +++ b/server.py @@ -143,19 +143,11 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data): try: print("[*] Started the request. %s" % (str(addr[0]))) - retry = False - while True: - try: - if scheme in [b'https', b'tls', b'ssl'] and method == b'CONNECT': - conn, data = proxy_connect(webserver, conn) - except IOError as e: - if not retry: - retry = True - print ("[*] Retrying SSL negotiation... (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e))) - else: - raise Exception("IOError: %s" % (str(e))) - except Exception as e: - raise Exception("SSL negotiation failed. (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e))) + try: + if scheme in [b'https', b'tls', b'ssl'] and method == b'CONNECT': + conn, data = proxy_connect(webserver, conn) + except Exception as e: + raise Exception("SSL negotiation failed. (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e))) response = b''