mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-24 04:14:57 +08:00
changed error handling (ssl spoof mode)
This commit is contained in:
@@ -1347,7 +1347,12 @@ class HTTPHandler(ProtocolHandler):
|
||||
|
||||
if self.c.config.mode == "sslspoof":
|
||||
# SNI is processed in server.py
|
||||
return None
|
||||
if not (flow.server_conn and flow.server_conn.ssl_established):
|
||||
print ":::::::::::::::"
|
||||
raise http.HttpError(
|
||||
400,
|
||||
"Invalid request: No host information"
|
||||
)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
@@ -123,14 +123,10 @@ class ConnectionHandler:
|
||||
self.set_server_address(("-", port))
|
||||
self.establish_ssl(client=True)
|
||||
host = self.client_conn.connection.get_servername()
|
||||
if host is None:
|
||||
raise ProxyError(
|
||||
400,
|
||||
"Invalid request: No host information"
|
||||
)
|
||||
self.set_server_address((host, port))
|
||||
self.establish_server_connection()
|
||||
self.establish_ssl(server=True, sni=host)
|
||||
if host:
|
||||
self.set_server_address((host, port))
|
||||
self.establish_server_connection()
|
||||
self.establish_ssl(server=True, sni=host)
|
||||
|
||||
# Delegate handling to the protocol handler
|
||||
protocol_handler(
|
||||
|
||||
Reference in New Issue
Block a user