From 4da4e9b8a8260a55f734fefcf80ce64fc6dbdfc5 Mon Sep 17 00:00:00 2001 From: Mike Kazantsev Date: Mon, 11 Feb 2013 13:56:04 +0100 Subject: skype: handle socket errors during tls session negotiation in a graceful way Before this patch, such errors (which happen 1/4 times here) lock skyped forever, producing traceback (and hanging because threads in python). Proper fix would be to see why these happen (might be ssl handling in the plugin), but that's no excuse not to handle socket errors without crashing the daemon. --- protocols/skype/skyped.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'protocols/skype/skyped.py') diff --git a/protocols/skype/skyped.py b/protocols/skype/skyped.py index 68008fbf..ae4df6a2 100644 --- a/protocols/skype/skyped.py +++ b/protocols/skype/skyped.py @@ -201,9 +201,13 @@ def listener(sock, skype): certfile=options.config.sslcert, keyfile=options.config.sslkey, ssl_version=ssl.PROTOCOL_TLSv1) - except ssl.SSLError: - dprint("Warning, SSL init failed, did you create your certificate?") - return False + except (ssl.SSLError, socket.error) as err: + if isinstance(err, ssl.SSLError): + dprint("Warning, SSL init failed, did you create your certificate?") + return False + else: + dprint('Warning, SSL init failed') + return True if hasattr(options.conn, 'handshake'): try: options.conn.handshake() -- cgit v1.2.3