2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 02:52:07 +00:00

Have apiclient timeout if IO hangs up

This commit is contained in:
Jarrod Johnson 2023-05-09 16:04:24 -04:00
parent ec54ecc9cd
commit 430b24081c

View File

@ -356,6 +356,7 @@ class HTTPSClient(client.HTTPConnection, object):
def connect(self):
addrinf = socket.getaddrinfo(self.host, self.port)[0]
psock = socket.socket(addrinf[0])
psock.settimeout(15)
psock.connect(addrinf[4])
ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
ctx.load_verify_locations('/etc/confluent/ca.pem')