Skip to content
Myr

Add debug logging to SSLConfig (#378)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Seth Michael Larson · committed by Florimond Manca · parent e62e5c3 · Browse files · 1 file+14 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+14 added−1 removed

  • other:+14 added−1 removed

1 file+14 added−1 removed

modified:httpx/config.py+14 added-1 removed
4 unmodified lines
56import certifi78from .__version__ import __version__9from .utils import get_ca_bundle_from_env9from .utils import get_ca_bundle_from_env, get_logger1011CertTypes = typing.Union[str, typing.Tuple[str, str], typing.Tuple[str, str, str]]12VerifyTypes = typing.Union[str, bool, ssl.SSLContext]13TimeoutTypes = typing.Union[float, typing.Tuple[float, float, float], "TimeoutConfig"]
25 unmodified lines
39 ]40)414243logger = get_logger(__name__)444546class SSLConfig:47 """48 SSL Configuration.49 """
43 unmodified lines
93 self, http_versions: "HTTPVersionConfig" = None94 ) -> ssl.SSLContext:95 http_versions = HTTPVersionConfig() if http_versions is None else http_versions9697 logger.debug(98 f"load_ssl_context "99 f"verify={self.verify!r} "100 f"cert={self.cert!r} "101 f"trust_env={self.trust_env!r} "102 f"http_versions={http_versions!r}"103 )104105 if self.ssl_context is None:106 self.ssl_context = (107 self.load_ssl_context_verify(http_versions=http_versions)108 if self.verify
53 unmodified lines
162 except AttributeError: # pragma: nocover163 pass164165 if ca_bundle_path.is_file():166 logger.debug(f"load_verify_locations cafile={ca_bundle_path!s}")167 context.load_verify_locations(cafile=str(ca_bundle_path))168 elif ca_bundle_path.is_dir():169 logger.debug(f"load_verify_locations capath={ca_bundle_path!s}")170 context.load_verify_locations(capath=str(ca_bundle_path))171172 self._load_client_certs(context)173
180 unmodified lines