@@ -217,24 +217,23 @@ def __init__(self, cache=None, timeout=None, max_redirects=5,
217
217
self .cache = cache
218
218
self .max_redirects = max_redirects
219
219
self .perm_redirects = {}
220
+
220
221
self ._disable_ssl_verification = False
221
222
self ._timeout = timeout
222
223
self .connection_pool = ConnectionPool (
223
224
self ._timeout ,
224
225
disable_ssl_verification = self ._disable_ssl_verification )
226
+
225
227
self .retry_delays = list (retry_delays ) # We don't want this changing on us.
226
228
self .retryable_errors = set (retryable_errors )
227
229
228
230
def disable_ssl_verification (self ):
229
- """
230
- Disable verification of SSL certificates and re-initialize the ConnectionPool.
231
- Only applicable on Python 2.7.9+ as previous versions of Python don't verify
232
- SSL certs.
233
-
234
- :return:
235
- """
231
+ """Disable verification of SSL certificates and re-initialize the
232
+ ConnectionPool. Only applicable on Python 2.7.9+ as previous versions
233
+ of Python don't verify SSL certs."""
236
234
self ._disable_ssl_verification = True
237
- self .connection_pool = ConnectionPool (self ._timeout , disable_ssl_verification = self ._disable_ssl_verification )
235
+ self .connection_pool = ConnectionPool (self ._timeout ,
236
+ disable_ssl_verification = self ._disable_ssl_verification )
238
237
239
238
def request (self , method , url , body = None , headers = None , credentials = None ,
240
239
num_redirects = 0 ):
@@ -437,12 +436,10 @@ def _clean(self):
437
436
438
437
439
438
class InsecureHTTPSConnection (HTTPSConnection ):
440
- """ Wrapper class to create an HTTPSConnection without SSl verification (the default behavior in
441
- Python < 2.7.9).
442
-
443
- See: https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection
444
- """
445
- if sys .version_info >= (2 ,7 ,9 ):
439
+ """Wrapper class to create an HTTPSConnection without SSL verification
440
+ (the default behavior in Python < 2.7.9). See:
441
+ https://docs.python.org/2/library/httplib.html#httplib.HTTPSConnection"""
442
+ if sys .version_info >= (2 , 7 , 9 ):
446
443
def __init__ (self , * a , ** k ):
447
444
k ['context' ] = ssl ._create_unverified_context ()
448
445
HTTPSConnection .__init__ (self , * a , ** k )
0 commit comments