replay: carry over SNI value

This commit is contained in:
Maximilian Hils 2014-10-02 00:58:40 +02:00
parent c2634476e5
commit 6ce6b1ad69
2 changed files with 4 additions and 6 deletions

View File

@ -2,10 +2,7 @@ include mitmproxy mitmdump
include LICENSE CHANGELOG CONTRIBUTORS README.txt
exclude README.mkd
recursive-include examples *
recursive-exclude examples *.pyc *.pyo *.swo *.swp
recursive-include doc *
recursive-exclude doc *.pyc *.pyo *.swo *.swp
recursive-include test *
recursive-exclude test *.pyc *.pyo *.swo *.swp
recursive-include libmproxy *
recursive-exclude libmproxy *.pyc *.pyo *.swo *.swp
recursive-exclude * *.pyc *.pyo *.swo *.swp

View File

@ -1304,7 +1304,7 @@ class RequestReplayThread(threading.Thread):
server.connect()
if r.scheme == "https":
send_connect_request(server, r.host, r.port)
server.establish_ssl(self.config.clientcerts, sni=r.host)
server.establish_ssl(self.config.clientcerts, sni=self.flow.server_conn.sni)
r.form_out = "relative"
else:
r.form_out = "absolute"
@ -1313,10 +1313,11 @@ class RequestReplayThread(threading.Thread):
server = ServerConnection(server_address)
server.connect()
if r.scheme == "https":
server.establish_ssl(self.config.clientcerts, sni=r.host)
server.establish_ssl(self.config.clientcerts, sni=self.flow.server_conn.sni)
r.form_out = "relative"
server.send(r.assemble())
self.flow.server_conn = server
self.flow.response = HTTPResponse.from_stream(server.rfile, r.method,
body_size_limit=self.config.body_size_limit)
self.channel.ask("response", self.flow)