@@ -1343,17 +1343,14 @@ def connect(scheme, host, port):
1343
1343
if timeout is not None : kwargs ['timeout' ] = timeout
1344
1344
if scheme == "http" :
1345
1345
return six .moves .http_client .HTTPConnection (host , port , ** kwargs )
1346
- if scheme == "https" and verify :
1347
- if hasssl :
1348
- if key_file is not None : kwargs ['key_file' ] = key_file
1349
- if cert_file is not None : kwargs ['cert_file' ] = cert_file
1350
-
1351
- # If running Python 2.7.9+, disable SSL certificate validation
1352
- if (sys .version_info >= (2 ,7 ,9 ) and key_file is None and cert_file is None ) or not verify :
1353
- kwargs ['context' ] = ssl ._create_unverified_context ()
1354
- return six .moves .http_client .HTTPSConnection (host , port , ** kwargs )
1355
- else :
1356
- raise ImportError ('No SSL library found' )
1346
+ if scheme == "https" :
1347
+ if key_file is not None : kwargs ['key_file' ] = key_file
1348
+ if cert_file is not None : kwargs ['cert_file' ] = cert_file
1349
+
1350
+ # If running Python 2.7.9+, disable SSL certificate validation
1351
+ if (sys .version_info >= (2 ,7 ,9 ) and key_file is None and cert_file is None ) or not verify or not hasssl :
1352
+ kwargs ['context' ] = ssl ._create_unverified_context ()
1353
+ return six .moves .http_client .HTTPSConnection (host , port , ** kwargs )
1357
1354
raise ValueError ("unsupported scheme: %s" % scheme )
1358
1355
1359
1356
def request (url , message , ** kwargs ):
0 commit comments