aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2017-01-16 14:03:17 -0500
committerGitHub <noreply@github.com>2017-01-16 14:03:17 -0500
commit03fd4f4193ef51ee91fd5707ced27701cf322c22 (patch)
tree8b54f271aa4e4aa8fba0f0ee686ca57f0081810d
parenta35041b04f1abb8b462ad5a25c8b038a33384864 (diff)
parentbad51fc70140efc0d9fdf5de632ca4798b995752 (diff)
downloadexternal_python_setuptools-03fd4f4193ef51ee91fd5707ced27701cf322c22.tar.gz
external_python_setuptools-03fd4f4193ef51ee91fd5707ced27701cf322c22.tar.bz2
external_python_setuptools-03fd4f4193ef51ee91fd5707ced27701cf322c22.zip
Merge pull request #921 from GreatFruitOmsk/fix-find_ca_bundle
Fix certifi fallback is not used on Windows.
-rw-r--r--setuptools/ssl_support.py21
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