aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/pathod.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-06-20 10:59:38 +1200
committerAldo Cortesi <aldo@nullcube.com>2012-06-20 10:59:38 +1200
commitde00497b4098fece043a1550a94e112829bcbceb (patch)
treeddb5742af895810a2a996ee49e74d8a52fd4d5fa /libpathod/pathod.py
parent7922e70037f56d71494cbe0c24fd7536ff76eeee (diff)
downloadmitmproxy-de00497b4098fece043a1550a94e112829bcbceb.tar.gz
mitmproxy-de00497b4098fece043a1550a94e112829bcbceb.tar.bz2
mitmproxy-de00497b4098fece043a1550a94e112829bcbceb.zip
Re-enable SSL service.
Diffstat (limited to 'libpathod/pathod.py')
-rw-r--r--libpathod/pathod.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/libpathod/pathod.py b/libpathod/pathod.py
index 9fabc026..8a29b9cb 100644
--- a/libpathod/pathod.py
+++ b/libpathod/pathod.py
@@ -5,6 +5,12 @@ import version, app, rparse
class PathodHandler(tcp.BaseHandler):
def handle(self):
+ if self.server.ssloptions:
+ self.convert_to_ssl(
+ self.server.ssloptions["certfile"],
+ self.server.ssloptions["keyfile"],
+ )
+
line = self.rfile.readline()
if line == "\r\n" or line == "\n": # Possible leftover from previous message
line = self.rfile.readline()
@@ -42,8 +48,9 @@ class PathodHandler(tcp.BaseHandler):
class Pathod(tcp.TCPServer):
- def __init__(self, addr, prefix="/p/"):
+ def __init__(self, addr, ssloptions=None, prefix="/p/"):
tcp.TCPServer.__init__(self, addr)
+ self.ssloptions = ssloptions
self.prefix = prefix
self.app = app.app
self.app.config["pathod"] = self