From b7e4217c8e87a1c393d0a9c7a1fb9a261683c983 Mon Sep 17 00:00:00 2001 From: MrRedAmber Date: Fri, 17 Mar 2017 20:20:03 -0600 Subject: [PATCH 1/2] Added a parameter to the Minio class initialization method that allows users to provide their own certificate bundle. One example use case scenario would be if a user wanted to provide a self signed certificate to use with their Minio object. If the user doesn\'t provide a certificate bundle themselves, Minio will default to using certifi\'s certificate bundle. --- minio/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/minio/api.py b/minio/api.py index 9350ae1d9..48c74d96a 100644 --- a/minio/api.py +++ b/minio/api.py @@ -119,7 +119,8 @@ class Minio(object): def __init__(self, endpoint, access_key=None, secret_key=None, secure=True, region=None, - timeout=None): + timeout=None, + certificate_bundle=certifi.where()): # Validate endpoint. is_valid_endpoint(endpoint) @@ -145,7 +146,7 @@ def __init__(self, endpoint, access_key=None, self._http = urllib3.PoolManager( timeout=self._conn_timeout, cert_reqs='CERT_REQUIRED', - ca_certs=certifi.where(), + ca_certs=certificate_bundle, retries=urllib3.Retry( total=5, backoff_factor=0.2, From c0712bc2e6bfd54d89a0775d8a54654a506e3a7c Mon Sep 17 00:00:00 2001 From: MrRedAmber Date: Fri, 17 Mar 2017 20:24:05 -0600 Subject: [PATCH 2/2] Removed unnecessary white spaces removed them from my previous commit --- minio/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minio/api.py b/minio/api.py index 48c74d96a..a2617f626 100644 --- a/minio/api.py +++ b/minio/api.py @@ -120,7 +120,7 @@ def __init__(self, endpoint, access_key=None, secret_key=None, secure=True, region=None, timeout=None, - certificate_bundle=certifi.where()): + certificate_bundle=certifi.where()): # Validate endpoint. is_valid_endpoint(endpoint)