From dc42e335058365ed7288463dcd8e5f61b03a87a2 Mon Sep 17 00:00:00 2001 From: Thomas Kriechbaumer Date: Wed, 22 Jul 2015 13:04:14 +0200 Subject: [PATCH] fix bugs --- libpathod/pathod.py | 8 ++++---- libpathod/protocols/http.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libpathod/pathod.py b/libpathod/pathod.py index 6f07ecc5d..5c813cc59 100644 --- a/libpathod/pathod.py +++ b/libpathod/pathod.py @@ -85,7 +85,7 @@ class PathodHandler(tcp.BaseHandler): self.use_http2 = False self.http2_framedump = http2_framedump - def _handle_sni(self, connection): + def handle_sni(self, connection): self.sni = connection.get_servername() def http_serve_crafted(self, crafted, logctx): @@ -132,8 +132,8 @@ class PathodHandler(tcp.BaseHandler): if isinstance(req, http.EmptyRequest): return None, None - if isinstance(req, http.ConnectRequest): - return self.protocol.handle_http_connect([req.host, req.port, req.path], lg) + if req.method == 'CONNECT': + return self.protocol.handle_http_connect([req.host, req.port, req.httpversion], lg) method = req.method path = req.path @@ -239,7 +239,7 @@ class PathodHandler(tcp.BaseHandler): self.convert_to_ssl( cert, key, - handle_sni=self._handle_sni, + handle_sni=self.handle_sni, request_client_cert=self.server.ssloptions.request_client_cert, cipher_list=self.server.ssloptions.ciphers, method=self.server.ssloptions.ssl_version, diff --git a/libpathod/protocols/http.py b/libpathod/protocols/http.py index 439e0ba92..825951260 100644 --- a/libpathod/protocols/http.py +++ b/libpathod/protocols/http.py @@ -56,7 +56,7 @@ class HTTPProtocol: self.pathod_handler.convert_to_ssl( cert, key, - handle_sni=self.pathod_handler._handle_sni, + handle_sni=self.pathod_handler.handle_sni, request_client_cert=self.pathod_handler.server.ssloptions.request_client_cert, cipher_list=self.pathod_handler.server.ssloptions.ciphers, method=self.pathod_handler.server.ssloptions.ssl_version,