mirror of
https://github.com/gnh1201/caterpillar.git
synced 2025-09-06 18:01:07 +00:00
Update server.py
This commit is contained in:
parent
54162b4e9e
commit
3183daf103
22
server.py
22
server.py
|
@ -185,18 +185,16 @@ def proxy_server(webserver, port, scheme, method, url, conn, addr, data):
|
||||||
try:
|
try:
|
||||||
print("[*] Started the request. %s" % (str(addr[0])))
|
print("[*] Started the request. %s" % (str(addr[0])))
|
||||||
|
|
||||||
retry = False
|
# SSL negotiation
|
||||||
try:
|
if scheme in [b'https', b'tls', b'ssl'] and method == b'CONNECT':
|
||||||
if scheme in [b'https', b'tls', b'ssl'] and method == b'CONNECT':
|
while True:
|
||||||
conn, data = proxy_connect(webserver, conn)
|
try:
|
||||||
except OSError as e:
|
conn, data = proxy_connect(webserver, conn)
|
||||||
if not retry:
|
break # success
|
||||||
print ("[*] Retrying SSL negotiation... (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e)))
|
except OSError as e:
|
||||||
retry = True
|
print ("[*] Retrying SSL negotiation... (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e)))
|
||||||
else:
|
except Exception as e:
|
||||||
raise Exception("SSL negotiation failed. (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e)))
|
raise Exception("SSL negotiation failed. (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e)))
|
||||||
except Exception as e:
|
|
||||||
raise Exception("SSL negotiation failed. (%s:%s) %s" % (webserver.decode(client_encoding), str(port), str(e)))
|
|
||||||
|
|
||||||
# Wait to see if there is more data to transmit
|
# Wait to see if there is more data to transmit
|
||||||
if len(data) == buffer_size:
|
if len(data) == buffer_size:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user