Commit bad51fc7 authored by Ilya Kulakov's avatar Ilya Kulakov

Fix certifi fallback is not used on Windows.

parent dbf57427
......@@ -237,14 +237,21 @@ def get_win_certfile():
def find_ca_bundle():
"""Return an existing CA bundle path, or None"""
ca_bundle_path = None
if os.name == 'nt':
return get_win_certfile()
ca_bundle_path = get_win_certfile()
else:
for cert_path in cert_paths:
if os.path.isfile(cert_path):
return cert_path
ca_bundle_path = cert_path
break
if ca_bundle_path is None:
try:
import certifi
return certifi.where()
ca_bundle_path = certifi.where()
except (ImportError, ResolutionError, ExtractionError):
return None
pass
return ca_bundle_path
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment