mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-04 15:34:01 -07:00
Fix py26 difference in ssl socket connect call from 99ba9d6
This commit is contained in:
parent
14b8e2cf01
commit
cd99821f8a
4 changed files with 35 additions and 1 deletions
|
@ -84,7 +84,10 @@ class CustomHTTPSConnection(httplib.HTTPSConnection):
|
|||
def connect(self):
|
||||
"Connect to a host on a given (SSL) port."
|
||||
|
||||
sock = socket.create_connection((self.host, self.port), self.timeout, self.source_address)
|
||||
if hasattr(self, 'source_address'):
|
||||
sock = socket.create_connection((self.host, self.port), self.timeout, self.source_address)
|
||||
else:
|
||||
sock = socket.create_connection((self.host, self.port), self.timeout)
|
||||
if self._tunnel_host:
|
||||
self.sock = sock
|
||||
self._tunnel()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue