kris10an / ZEAL

Handle Z-wave notification reports, battery reports and battery levels, as well as Z-wave network statistics
MIT License
0 stars 1 forks source link

api.github.com stopped supporting SSL TLSv1 #2

Open radekw opened 6 years ago

radekw commented 6 years ago

ZEAL is failing to start updating thread with the following error:

Traceback (most recent call last):
  File "plugin.py", line 303, in runConcurrentThread
  File "plugin.py", line 1326, in checkPluginUpdates
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/ZEAL.indigoPlugin/Contents/Server Plugin/ghpu.py", line 86, in checkForUpdate
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/ZEAL.indigoPlugin/Contents/Server Plugin/ghpu.py", line 173, in _prepareForUpdate
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/ZEAL.indigoPlugin/Contents/Server Plugin/ghpu.py", line 95, in getUpdate
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/ZEAL.indigoPlugin/Contents/Server Plugin/ghpu.py", line 115, in getLatestRelease
  File "/Library/Application Support/Perceptive Automation/Indigo 7/Plugins/ZEAL.indigoPlugin/Contents/Server Plugin/ghpu.py", line 143, in _GET
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1053, in request
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1093, in _send_request
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1049, in endheaders
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 893, in _send_output
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 855, in send
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1274, in connect
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 352, in wrap_socket
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 579, in __init__
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 808, in do_handshake
SSLError: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:590)

   ZEAL Error                      plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)
   ZEAL Error                      Error in plugin execution runConcurrentThread:

It could be patched with the following, but it turns out that included ssl library does not support higher protocols.

import ssl
context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
conn = httplib.HTTPSConnection('api.github.com', context=context)
kris10an commented 6 years ago

Release 0.3.7 temporary disables update checking, as a quick-fix. The new Indigo store has an api for checking updates, so this plugin should preferrably be updated to use that instead.