From 65ac1b3f001a297408437ee1dc7ebf661de2805d Mon Sep 17 00:00:00 2001 From: tomkat83 Date: Sun, 29 May 2016 17:56:55 +0200 Subject: [PATCH] Fix websockets still checking SSL certificates --- resources/lib/websocket_client.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/resources/lib/websocket_client.py b/resources/lib/websocket_client.py index ca9116b6..542822b6 100644 --- a/resources/lib/websocket_client.py +++ b/resources/lib/websocket_client.py @@ -88,15 +88,13 @@ class WebSocket(threading.Thread): uri = "%s/:/websockets/notifications" % server if token: uri += '?X-Plex-Token=%s' % token - return uri - - def run(self): - log = self.logMsg - # Currently not working due to missing SSL environment sslopt = {} if utils.settings('sslverify') == "false": sslopt["cert_reqs"] = ssl.CERT_NONE + return uri, sslopt + def run(self): + log = self.logMsg log("----===## Starting WebSocketClient ##===----", 0) threadStopped = self.threadStopped @@ -123,7 +121,7 @@ class WebSocket(threading.Thread): pass except websocket.WebSocketConnectionClosedException: log("Connection closed, (re)connecting", 0) - uri = self.getUri() + uri, sslopt = self.getUri() try: # Low timeout - let's us shut this thread down! self.ws = websocket.create_connection( @@ -132,6 +130,7 @@ class WebSocket(threading.Thread): sslopt=sslopt, enable_multithread=True) except IOError: + # Server is probably offline log("Error connecting", 0) self.ws = None xbmc.sleep(1000)