Skip to content

Commit 4ee982a

Browse files
abhinavsinghdmitriyvolkpre-commit-ci[bot]
authored
Honor ca-file for reverse proxy upstream connections (#1283)
* Make reverse proxy honor ca-file flag * Add stupid logging * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove print statements * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Trigger build Co-authored-by: Dmitriy Volk <dmitriy@dominodatalab.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c200e63 commit 4ee982a

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

proxy/http/handler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ async def handle_readables(self, readables: Readables) -> bool:
234234
logger.warning(
235235
'Exception when receiving from %s connection#%d with reason %r' %
236236
(self.work.tag, self.work.connection.fileno(), e),
237+
exc_info=True,
237238
)
238239
return True
239240
return False

proxy/http/server/reverse.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
import logging
1414
from typing import TYPE_CHECKING, Any, Dict, List, Tuple, Optional
1515

16-
from . import HttpWebServerBasePlugin, httpProtocolTypes
17-
from .. import Url
18-
from ..parser import HttpParser
19-
from ..exception import HttpProtocolException
20-
from ...core.base import TcpUpstreamConnectionHandler
21-
from ...common.utils import text_
22-
from ...common.constants import (
16+
from proxy.http import Url
17+
from proxy.core.base import TcpUpstreamConnectionHandler
18+
from proxy.http.parser import HttpParser
19+
from proxy.http.server import HttpWebServerBasePlugin, httpProtocolTypes
20+
from proxy.common.utils import text_
21+
from proxy.http.exception import HttpProtocolException
22+
from proxy.common.constants import (
2323
HTTPS_PROTO, DEFAULT_HTTP_PORT, DEFAULT_HTTPS_PORT,
2424
DEFAULT_REVERSE_PROXY_ACCESS_LOG_FORMAT,
2525
)
@@ -99,6 +99,7 @@ def handle_request(self, request: HttpParser) -> None:
9999
self.choice.hostname,
100100
),
101101
as_non_blocking=True,
102+
ca_file=self.flags.ca_file,
102103
)
103104
request.path = self.choice.remainder
104105
self.upstream.queue(memoryview(request.build()))

0 commit comments

Comments
 (0)