aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-26 10:15:11 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-26 10:15:11 +1200
commitf32258e8f7eb2f4b43a704a003f00c32efbb898c (patch)
tree66cb3057f2092c893fef1c3c1d84f233462d213d /libpathod
parent8352c0278f468be30a9765a61f369ceb317aafe9 (diff)
downloadmitmproxy-f32258e8f7eb2f4b43a704a003f00c32efbb898c.tar.gz
mitmproxy-f32258e8f7eb2f4b43a704a003f00c32efbb898c.tar.bz2
mitmproxy-f32258e8f7eb2f4b43a704a003f00c32efbb898c.zip
Port pathoc to new netlib API. Add SNI.
Diffstat (limited to 'libpathod')
-rw-r--r--libpathod/pathoc.py4
-rw-r--r--libpathod/pathod.py5
2 files changed, 7 insertions, 2 deletions
diff --git a/libpathod/pathoc.py b/libpathod/pathoc.py
index 5105decf..7b49d0b1 100644
--- a/libpathod/pathoc.py
+++ b/libpathod/pathoc.py
@@ -15,9 +15,9 @@ def print_full(fp, httpversion, code, msg, headers, content):
class Pathoc(tcp.TCPClient):
- def __init__(self, ssl, host, port, clientcert):
+ def __init__(self, host, port):
try:
- tcp.TCPClient.__init__(self, ssl, host, port, clientcert)
+ tcp.TCPClient.__init__(self, host, port)
except tcp.NetLibError, v:
raise PathocError(v)
diff --git a/libpathod/pathod.py b/libpathod/pathod.py
index db7f37f1..2ef3b0bf 100644
--- a/libpathod/pathod.py
+++ b/libpathod/pathod.py
@@ -7,6 +7,10 @@ class PathodError(Exception): pass
class PathodHandler(tcp.BaseHandler):
+ sni = None
+ def handle_sni(self, connection):
+ self.sni = connection.get_servername()
+
def handle(self):
if self.server.ssloptions:
self.convert_to_ssl(
@@ -50,6 +54,7 @@ class PathodHandler(tcp.BaseHandler):
path = path,
method = method,
headers = headers.lst,
+ sni = self.sni,
#remote_address = self.request.connection.address,
#full_url = self.request.full_url(),
#query = self.request.query,