As per #1105, certifi is being end-of-lifed. Requests will use either
its own vendored bundle, or possibly (when packaged with OS distributions)
an externally packaged bundle, which can be enabled by patching
requests.certs.where().
import os.path
-certifi = None
-try:
- import certifi
-except ImportError:
- pass
-
def where():
"""Return the preferred certificate bundle."""
- if certifi:
- return certifi.where()
-
+ # vendored bundle inside Requests
return os.path.join(os.path.dirname(__file__), 'cacert.pem')
if __name__ == '__main__':
NETRC_FILES = ('.netrc', '_netrc')
-# if certifi is installed, use its CA bundle;
-# otherwise, try and use the OS bundle
DEFAULT_CA_BUNDLE_PATH = certs.where()
def dict_to_sequence(d):