mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Disable custom https handler for fetch_url on older pythons
Fixes #8898
This commit is contained in:
parent
f14dba8b2f
commit
8bafc646cb
1 changed files with 4 additions and 1 deletions
|
@ -396,7 +396,10 @@ def fetch_url(module, url, data=None, headers=None, method=None,
|
|||
proxyhandler = urllib2.ProxyHandler({})
|
||||
handlers.append(proxyhandler)
|
||||
|
||||
handlers.append(CustomHTTPSHandler)
|
||||
# pre-2.6 versions of python cannot use the custom https
|
||||
# handler, since the socket class is lacking this method
|
||||
if hasattr(socket, 'create_connection'):
|
||||
handlers.append(CustomHTTPSHandler)
|
||||
|
||||
opener = urllib2.build_opener(*handlers)
|
||||
urllib2.install_opener(opener)
|
||||
|
|
Loading…
Reference in a new issue