From 8515f9a9fc8705d0bd6f3d9beff7b9841efd6fff Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Tue, 7 Feb 2017 16:42:02 +0100 Subject: [PATCH] Set SSL socket to blocking - otherwise the error handling gets too complicated --- src/class_receiveDataThread.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/class_receiveDataThread.py b/src/class_receiveDataThread.py index b7bc50ad..6e592304 100644 --- a/src/class_receiveDataThread.py +++ b/src/class_receiveDataThread.py @@ -318,6 +318,8 @@ class receiveDataThread(threading.Thread): logger.error("SSL socket handhake failed, shutting down connection", exc_info=True) self.sendDataThreadQueue.put((0, 'shutdown','tls handshake fail')) return + # SSL in the background should be blocking, otherwise the error handling is difficult + self.sslSock.settimeout(None) # Command the corresponding sendDataThread to set its own connectionIsOrWasFullyEstablished variable to True also self.sendDataThreadQueue.put((0, 'connectionIsOrWasFullyEstablished', (self.services, self.sslSock)))