Fix websockets still checking SSL certificates
This commit is contained in:
parent
af73f2be1f
commit
65ac1b3f00
1 changed files with 5 additions and 6 deletions
|
@ -88,15 +88,13 @@ class WebSocket(threading.Thread):
|
||||||
uri = "%s/:/websockets/notifications" % server
|
uri = "%s/:/websockets/notifications" % server
|
||||||
if token:
|
if token:
|
||||||
uri += '?X-Plex-Token=%s' % token
|
uri += '?X-Plex-Token=%s' % token
|
||||||
return uri
|
|
||||||
|
|
||||||
def run(self):
|
|
||||||
log = self.logMsg
|
|
||||||
# Currently not working due to missing SSL environment
|
|
||||||
sslopt = {}
|
sslopt = {}
|
||||||
if utils.settings('sslverify') == "false":
|
if utils.settings('sslverify') == "false":
|
||||||
sslopt["cert_reqs"] = ssl.CERT_NONE
|
sslopt["cert_reqs"] = ssl.CERT_NONE
|
||||||
|
return uri, sslopt
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
log = self.logMsg
|
||||||
log("----===## Starting WebSocketClient ##===----", 0)
|
log("----===## Starting WebSocketClient ##===----", 0)
|
||||||
|
|
||||||
threadStopped = self.threadStopped
|
threadStopped = self.threadStopped
|
||||||
|
@ -123,7 +121,7 @@ class WebSocket(threading.Thread):
|
||||||
pass
|
pass
|
||||||
except websocket.WebSocketConnectionClosedException:
|
except websocket.WebSocketConnectionClosedException:
|
||||||
log("Connection closed, (re)connecting", 0)
|
log("Connection closed, (re)connecting", 0)
|
||||||
uri = self.getUri()
|
uri, sslopt = self.getUri()
|
||||||
try:
|
try:
|
||||||
# Low timeout - let's us shut this thread down!
|
# Low timeout - let's us shut this thread down!
|
||||||
self.ws = websocket.create_connection(
|
self.ws = websocket.create_connection(
|
||||||
|
@ -132,6 +130,7 @@ class WebSocket(threading.Thread):
|
||||||
sslopt=sslopt,
|
sslopt=sslopt,
|
||||||
enable_multithread=True)
|
enable_multithread=True)
|
||||||
except IOError:
|
except IOError:
|
||||||
|
# Server is probably offline
|
||||||
log("Error connecting", 0)
|
log("Error connecting", 0)
|
||||||
self.ws = None
|
self.ws = None
|
||||||
xbmc.sleep(1000)
|
xbmc.sleep(1000)
|
||||||
|
|
Loading…
Reference in a new issue