From b815de2adf4d02bf010f475e01584dc3a95fda94 Mon Sep 17 00:00:00 2001 From: Dmitriy Volk Date: Thu, 13 Oct 2022 16:08:31 -0700 Subject: [PATCH 1/3] Make reverse proxy honor ca-file flag --- proxy/http/server/reverse.py | 1 + 1 file changed, 1 insertion(+) diff --git a/proxy/http/server/reverse.py b/proxy/http/server/reverse.py index 63bd3d6537..6eab123c90 100644 --- a/proxy/http/server/reverse.py +++ b/proxy/http/server/reverse.py @@ -86,6 +86,7 @@ def handle_request(self, request: HttpParser) -> None: self.choice.hostname, ), as_non_blocking=True, + ca_file=self.flags.ca_file, ) request.path = self.choice.remainder self.upstream.queue(memoryview(request.build())) From a4ee2bf21476a1008940814093fb9bc0f73a9a90 Mon Sep 17 00:00:00 2001 From: Dmitriy Volk Date: Fri, 14 Oct 2022 14:20:08 -0700 Subject: [PATCH 2/3] Add stupid logging --- proxy/http/handler.py | 1 + proxy/http/server/reverse.py | 1 + 2 files changed, 2 insertions(+) diff --git a/proxy/http/handler.py b/proxy/http/handler.py index c8d070411c..4bd471ad6b 100644 --- a/proxy/http/handler.py +++ b/proxy/http/handler.py @@ -234,6 +234,7 @@ async def handle_readables(self, readables: Readables) -> bool: logger.warning( 'Exception when receiving from %s connection#%d with reason %r' % (self.work.tag, self.work.connection.fileno(), e), + exc_info=True ) return True return False diff --git a/proxy/http/server/reverse.py b/proxy/http/server/reverse.py index 6eab123c90..678cd621c5 100644 --- a/proxy/http/server/reverse.py +++ b/proxy/http/server/reverse.py @@ -81,6 +81,7 @@ def handle_request(self, request: HttpParser) -> None: try: self.upstream.connect() if self.choice.scheme == HTTPS_PROTO: + print(f"=-=-=-=-=-=-=-=-=-=-=- {self.flags.ca_file}") self.upstream.wrap( text_( self.choice.hostname, From f4556bdad7979b139cdb2f46b33e3063f376b6bf Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 14 Oct 2022 21:37:03 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- proxy/http/handler.py | 2 +- proxy/http/server/reverse.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/http/handler.py b/proxy/http/handler.py index 4bd471ad6b..b8d207d561 100644 --- a/proxy/http/handler.py +++ b/proxy/http/handler.py @@ -234,7 +234,7 @@ async def handle_readables(self, readables: Readables) -> bool: logger.warning( 'Exception when receiving from %s connection#%d with reason %r' % (self.work.tag, self.work.connection.fileno(), e), - exc_info=True + exc_info=True, ) return True return False diff --git a/proxy/http/server/reverse.py b/proxy/http/server/reverse.py index 678cd621c5..a1bfb90831 100644 --- a/proxy/http/server/reverse.py +++ b/proxy/http/server/reverse.py @@ -81,7 +81,7 @@ def handle_request(self, request: HttpParser) -> None: try: self.upstream.connect() if self.choice.scheme == HTTPS_PROTO: - print(f"=-=-=-=-=-=-=-=-=-=-=- {self.flags.ca_file}") + print(f'=-=-=-=-=-=-=-=-=-=-=- {self.flags.ca_file}') self.upstream.wrap( text_( self.choice.hostname,