diff options
author | Ilya Kulakov <kulakov.ilya@gmail.com> | 2017-01-13 18:20:28 -0800 |
---|---|---|
committer | Ilya Kulakov <kulakov.ilya@gmail.com> | 2017-01-13 18:22:49 -0800 |
commit | bad51fc70140efc0d9fdf5de632ca4798b995752 (patch) | |
tree | 72841c988bae2b1dacc54610e4adab29413e23c1 /setuptools/ssl_support.py | |
parent | dbf57427babbfbf58086b27c0d1d9b3503892daa (diff) | |
download | external_python_setuptools-bad51fc70140efc0d9fdf5de632ca4798b995752.tar.gz external_python_setuptools-bad51fc70140efc0d9fdf5de632ca4798b995752.tar.bz2 external_python_setuptools-bad51fc70140efc0d9fdf5de632ca4798b995752.zip |
Fix certifi fallback is not used on Windows.
Diffstat (limited to 'setuptools/ssl_support.py')
-rw-r--r-- | setuptools/ssl_support.py | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/setuptools/ssl_support.py b/setuptools/ssl_support.py index 82f8870a..661b6b52 100644 --- a/setuptools/ssl_support.py +++ b/setuptools/ssl_support.py @@ -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 - try: - import certifi - return certifi.where() - except (ImportError, ResolutionError, ExtractionError): - return None + ca_bundle_path = cert_path + break + + if ca_bundle_path is None: + try: + import certifi + ca_bundle_path = certifi.where() + except (ImportError, ResolutionError, ExtractionError): + pass + + return ca_bundle_path |