Skip to content

Commit

Permalink
Add cert_check flag to main class constructor (#1267)
Browse files Browse the repository at this point in the history
  • Loading branch information
walnuttiger8 authored May 20, 2023
1 parent 181e8e9 commit b8086bd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions minio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <Minio>` object
Example::
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit b8086bd

Please sign in to comment.