Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions setuptools/ssl_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,21 @@ def close(self):

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