aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-28 10:02:14 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-28 10:02:14 +1200
commit243e0efefc2ae6842a2d03c7d0a0e648802515b1 (patch)
tree035bc4bffee65210e2a14f6bf6f79955c7244fd8 /libmproxy/proxy.py
parent35ee0c098f1a9c492ddec34bf03f4f6741ac6d41 (diff)
downloadmitmproxy-243e0efefc2ae6842a2d03c7d0a0e648802515b1.tar.gz
mitmproxy-243e0efefc2ae6842a2d03c7d0a0e648802515b1.tar.bz2
mitmproxy-243e0efefc2ae6842a2d03c7d0a0e648802515b1.zip
Adjust for new get_remote_cert API.
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r--libmproxy/proxy.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index 0f68fe25..392714ff 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -193,13 +193,13 @@ class ProxyHandler(tcp.BaseHandler):
else:
return True
- def find_cert(self, host, port):
+ def find_cert(self, host, port, sni):
if self.config.certfile:
return self.config.certfile
else:
sans = []
if self.config.upstream_cert:
- cert = certutils.get_remote_cert(host, port)
+ cert = certutils.get_remote_cert(host, port, sni)
sans = cert.altnames
host = cert.cn
ret = certutils.dummy_cert(self.config.certdir, self.config.cacert, host, sans)
@@ -225,7 +225,7 @@ class ProxyHandler(tcp.BaseHandler):
host, port = self.config.transparent_proxy["resolver"].original_addr(self.connection)
if not self.ssl_established and (port in self.config.transparent_proxy["sslports"]):
scheme = "https"
- certfile = self.find_cert(host, port)
+ certfile = self.find_cert(host, port, None)
self.convert_to_ssl(certfile, self.config.certfile or self.config.cacert)
else:
scheme = "http"
@@ -274,7 +274,7 @@ class ProxyHandler(tcp.BaseHandler):
'\r\n'
)
self.wfile.flush()
- certfile = self.find_cert(host, port)
+ certfile = self.find_cert(host, port, None)
self.convert_to_ssl(certfile, self.config.certfile or self.config.cacert)
self.proxy_connect_state = (host, port, httpversion)
line = self.rfile.readline(line)