01-arcadia.patch 1.1 KB

123456789101112131415161718192021222324252627
  1. --- contrib/python/httpx/httpx/_config.py (499810bf8a30b39c38d23cdf60c243417fdf81ee)
  2. +++ contrib/python/httpx/httpx/_config.py (2e6e05a77528bac894ef025fa9cc552ac6cd0751)
  3. @@ -56,7 +56,11 @@ class SSLConfig:
  4. SSL Configuration.
  5. """
  6. - DEFAULT_CA_BUNDLE_PATH = Path(certifi.where())
  7. + DEFAULT_CA_BUNDLE_PATH = certifi.where()
  8. + if callable(DEFAULT_CA_BUNDLE_PATH):
  9. + DEFAULT_CA_BUNDLE_PATH = staticmethod(DEFAULT_CA_BUNDLE_PATH)
  10. + else:
  11. + DEFAULT_CA_BUNDLE_PATH = Path(DEFAULT_CA_BUNDLE_PATH)
  12. def __init__(
  13. self,
  14. @@ -137,7 +141,10 @@ class SSLConfig:
  15. except AttributeError: # pragma: nocover
  16. pass
  17. - if ca_bundle_path.is_file():
  18. + if callable(ca_bundle_path):
  19. + logger.debug("load_verify_locations cafile=%r", ca_bundle_path)
  20. + context.load_verify_locations(cafile=ca_bundle_path)
  21. + elif ca_bundle_path.is_file():
  22. cafile = str(ca_bundle_path)
  23. logger.debug("load_verify_locations cafile=%r", cafile)
  24. context.load_verify_locations(cafile=cafile)