aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/proxy.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-03-05 10:22:47 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-03-05 10:22:47 +1300
commite1356dd2b6a0293842d5ba4151ddc49f841f3cf6 (patch)
tree0765a5033cab57e759a3488e364d5dcf46275c29 /libmproxy/proxy.py
parent1790246fed463ea47d74b3cd99b24b5480ecc340 (diff)
downloadmitmproxy-e1356dd2b6a0293842d5ba4151ddc49f841f3cf6.tar.gz
mitmproxy-e1356dd2b6a0293842d5ba4151ddc49f841f3cf6.tar.bz2
mitmproxy-e1356dd2b6a0293842d5ba4151ddc49f841f3cf6.zip
Create an SSL certificate class.
Diffstat (limited to 'libmproxy/proxy.py')
-rw-r--r--libmproxy/proxy.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmproxy/proxy.py b/libmproxy/proxy.py
index a6ba790f..31308e6f 100644
--- a/libmproxy/proxy.py
+++ b/libmproxy/proxy.py
@@ -350,7 +350,9 @@ class ProxyHandler(SocketServer.StreamRequestHandler):
else:
sans = []
if self.config.upstream_cert:
- host, sans = certutils.get_remote_cn(host, port)
+ cert = certutils.get_remote_cert(host, port)
+ sans = cert.altnames
+ host = cert.cn
ret = certutils.dummy_cert(self.config.certdir, self.config.cacert, host, sans)
time.sleep(self.config.cert_wait_time)
if not ret: