aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/ssl_support.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/ssl_support.py')
-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