diff --git a/README.rst b/README.rst index 96d4ad1..fb8beb0 100644 --- a/README.rst +++ b/README.rst @@ -136,6 +136,9 @@ Environment variables API. - *SSL_VERIFY*: set to ‘0’ to deactivate SSL verification when talking to the DLRN API. +- *SSL_CA_BUNDLE*: when set to a value, it will instruct the client to + use that file to verify SSL certificates, instead of the default CA + bundle provided by `certifi`. Author ------ diff --git a/dlrnapi_client/configuration.py b/dlrnapi_client/configuration.py index f0d9e69..fae22b2 100644 --- a/dlrnapi_client/configuration.py +++ b/dlrnapi_client/configuration.py @@ -82,7 +82,9 @@ def __init__(self): else: self.verify_ssl = True # Set this to customize the certificate file to verify the peer. - self.ssl_ca_cert = None + # If SSL_CA_BUNDLE is not set, self.ssl_ca_cert will be None, + # so we will use the CA bundle provided by certifi + self.ssl_ca_cert = os.environ.get('SSL_CA_BUNDLE') # client certificate file self.cert_file = None # client key file