Re-enable SSL service.

This commit is contained in:
Aldo Cortesi 2012-06-20 10:59:38 +12:00
parent 7922e70037
commit de00497b40
2 changed files with 9 additions and 2 deletions

View File

@ -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

View File

@ -36,7 +36,7 @@ class PaThread(threading.Thread):
)
else:
ssloptions = self.ssl
self.server = pathod.Pathod((IFACE, 0))
self.server = pathod.Pathod((IFACE, 0), ssloptions=ssloptions)
#self.server, self.port = pathod.make_server(self.app, 0, IFACE, ssloptions)
self.q.put(self.server.port)
self.server.serve_forever()