From 01a9124b7dc9d0f45d65b1610dfb64e40400efd4 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Thu, 19 Jan 2017 19:52:54 +0100 Subject: [PATCH] Less verbose SSL handshake reporting - if SSL handshake fails, we don't need to stack trace because we know where it's happening. Only report the error string. --- src/class_receiveDataThread.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/class_receiveDataThread.py b/src/class_receiveDataThread.py index 70418f8d..250ae355 100644 --- a/src/class_receiveDataThread.py +++ b/src/class_receiveDataThread.py @@ -271,6 +271,10 @@ class receiveDataThread(threading.Thread): except ssl.SSLWantWriteError: logger.debug("Waiting for SSL socket handhake write") select.select([], [self.sslSock], [], 10) + except ssl.SSLError as e: + logger.error("SSL socket handhake failed: %s, shutting down connection", str(e)) + self.sendDataThreadQueue.put((0, 'shutdown','tls handshake fail %s' % (str(e)))) + return except: logger.error("SSL socket handhake failed, shutting down connection", exc_info=True) self.sendDataThreadQueue.put((0, 'shutdown','tls handshake fail'))