fix SNI for transparent mode - #1638

In transparent mode host is set with the target server ip.
Attribute flow.request.host is used as SNI while mitmproxy is
initiating TLS handshake, so it should be set with the pretty_host.
This commit is contained in:
phackt 2016-11-08 15:39:24 +01:00
parent 184e29e119
commit dc44465c92

View File

@ -16,6 +16,7 @@ def request(flow):
if flow.request.pretty_host in secure_hosts: if flow.request.pretty_host in secure_hosts:
flow.request.scheme = 'https' flow.request.scheme = 'https'
flow.request.port = 443 flow.request.port = 443
flow.request.host = flow.request.pretty_host
def response(flow): def response(flow):