diff --git a/proxy/http/proxy/plugin.py b/proxy/http/proxy/plugin.py index b44b1a872f..c1dfd34fa4 100644 --- a/proxy/http/proxy/plugin.py +++ b/proxy/http/proxy/plugin.py @@ -19,6 +19,7 @@ from ...common.utils import tls_interception_enabled from ...core.connection import TcpServerConnection + if TYPE_CHECKING: # pragma: no cover from ...common.types import HostPort from ...core.connection import UpstreamConnectionPool diff --git a/proxy/http/proxy/server.py b/proxy/http/proxy/server.py index 2361a2bf1d..fcaf3e7306 100644 --- a/proxy/http/proxy/server.py +++ b/proxy/http/proxy/server.py @@ -793,8 +793,8 @@ def _wrap_server( # we will cache such upstream hosts and avoid intercepting them for future # requests. logger.warning( - "ssl.SSLCertVerificationError: " - + "Server raised cert verification error for upstream: {0}".format( + 'ssl.SSLCertVerificationError: ' + + 'Server raised cert verification error for upstream: {0}'.format( upstream.addr[0], ), ) @@ -802,14 +802,14 @@ def _wrap_server( except ssl.SSLError as e: if e.reason == 'SSLV3_ALERT_HANDSHAKE_FAILURE': logger.warning( - "{0}: ".format(e.reason) - + "Server raised handshake alert failure for upstream: {0}".format( + '{0}: '.format(e.reason) + + 'Server raised handshake alert failure for upstream: {0}'.format( upstream.addr[0], ), ) else: logger.exception( - "SSLError when wrapping client for upstream: {0}".format( + 'SSLError when wrapping client for upstream: {0}'.format( upstream.addr[0], ), exc_info=e, diff --git a/proxy/plugin/proxy_pool.py b/proxy/plugin/proxy_pool.py index a70e3dc18f..eecac398a2 100644 --- a/proxy/plugin/proxy_pool.py +++ b/proxy/plugin/proxy_pool.py @@ -15,7 +15,6 @@ from typing import Any, Dict, List, Optional from proxy.core.connection import TcpServerConnection - from ..http import Url, httpHeaders, httpMethods from ..core.base import TcpUpstreamConnectionHandler from ..http.proxy import HttpProxyBasePlugin