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