From b8086bdad4636e8449cc7169e60eba85840db29a Mon Sep 17 00:00:00 2001 From: Bulat Sharipov Date: Sat, 20 May 2023 21:12:01 +0300 Subject: [PATCH] Add cert_check flag to main class constructor (#1267) --- minio/api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/minio/api.py b/minio/api.py index 445c25b51..d0648a5fb 100644 --- a/minio/api.py +++ b/minio/api.py @@ -87,6 +87,7 @@ class Minio: # pylint: disable=too-many-public-methods :param region: Region name of buckets in S3 service. :param http_client: Customized HTTP client. :param credentials: Credentials provider of your account in S3 service. + :param cert_check: Flag to indicate to verify SSL certificate or not. :return: :class:`Minio ` object Example:: @@ -119,7 +120,8 @@ def __init__(self, endpoint, access_key=None, secure=True, region=None, http_client=None, - credentials=None): + credentials=None, + cert_check=True): # Validate http client has correct base class. if http_client and not isinstance( http_client, @@ -145,7 +147,7 @@ def __init__(self, endpoint, access_key=None, self._http = http_client or urllib3.PoolManager( timeout=urllib3.util.Timeout(connect=timeout, read=timeout), maxsize=10, - cert_reqs='CERT_REQUIRED', + cert_reqs='CERT_REQUIRED' if cert_check else 'CERT_NONE', ca_certs=os.environ.get('SSL_CERT_FILE') or certifi.where(), retries=urllib3.Retry( total=5,