Solved Kodi 17 Krypton - SSL issues
#1
Dear all,

I am facing some issues regarding HTTPS requests in OSX through python addons. Not sure if this is a known issue or otherwise just a problem on my end, hence decided to post seeking advice.
These problems are affecting some of my addons, namely the KordKutters addon that can be installed through the official repository. This issue only occurs in my OSX setup. I can't reproduce the error neither in Linux arm, in Android or Linux x64.

Quote:15:41:22 T:123145312653312 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <type 'exceptions.IOError'>
Error Contents: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
Traceback (most recent call last):
File "/Users/enen/Library/Application Support/Kodi/addons/plugin.video.kordkutters/addon.py", line 91, in <module>
get_playlists()
File "/Users/enen/Library/Application Support/Kodi/addons/plugin.video.kordkutters/resources/lib/youtubewrapper.py", line 35, in get_playlists
raw = urllib.urlopen(url)
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/urllib.py", line 87, in urlopen
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/urllib.py", line 213, in open
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/urllib.py", line 443, in open_https
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/httplib.py", line 1053, in endheaders
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/httplib.py", line 897, in _send_output
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/httplib.py", line 859, in send
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/httplib.py", line 1278, in connect
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/ssl.py", line 353, in wrap_socket
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/ssl.py", line 601, in __init__
File "/Users/Shared/jenkins/workspace/OSX-64/tools/depends/xbmc-depends/macosx10.10_x86_64-target/lib/python2.7/ssl.py", line 830, in do_handshake
IOError: [Errno socket error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
-->End of Python script error report<--
15:41:22 T:140735260250112 DEBUG: ------ Window Init (DialogNotification.xml) ------

I am using the latest nightly build (kodi-20160712-89ef699-master-x86_64). The code works correctly using system python.

Below is the code that is triggering the error:

PHP Code:
import urllib
url 
'https://www.googleapis.com/youtube/v3/playlists?part=snippet,contentDetails&channelId=UCtp9s4L-kxIRy221VVtgjXg&maxResults=50&key=AIzaSyAxaHJTQ5zgh86wk7geOwm-y0YyNMcEkSc'
raw urllib.urlopen(url

Any help is greatly appreciated

Regards
Reply
#2
Set environment variable SSL_CERT_FILE to the certificate you want to use. If you don't have any, you can download this one:
https://github.com/xbmc/xbmc/blob/master...cacert.pem

Then start Kodi with the environment variable set.

maybe @Memphiz can update the package to do this implicitly.
Reply
#3
(2016-07-13, 17:51)FernetMenta Wrote: Set environment variable SSL_CERT_FILE to the certificate you want to use. If you don't have any, you can download this one:
https://github.com/xbmc/xbmc/blob/master...cacert.pem

Then start Kodi with the environment variable set.

maybe @Memphiz can update the package to do this implicitly.

Thanks for your help, that made the trick.
It would be great if it worked out of the box though. Should I fill a trac issue?

Cheers
Reply
#4
@FernetMenta - could the same approach like for android be used here?

https://github.com/xbmc/xbmc/blob/master...n.cpp#L598
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#5
I also have a few add-ons which get ssl errors.

Kodi (17.0-ALPHA2 Git:2016-06-30-f3ca4ea).

I have experimented with brew and openssl as well as python.org mac version - ssl seems fine in these without certificate errors.

Debug for abc-iview and debug for log uploader

Any help would be appreciated.
Reply
#6
The fix is in discussion:

https://github.com/xbmc/xbmc/pull/10108
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#7
This should be fixed in next nightly build.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#8
I still get an error (looks different though) using log uploader

Debug

extract for interest:

20:34:44 T:123145309356032 DEBUG: Kodi Log Uploader: reading log...
20:34:44 T:123145309356032 DEBUG: Kodi Log Uploader: starting upload "/Users/tv/Library/Logs/kodi.log"...
20:34:49 T:123145309356032 ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'urllib2.HTTPError'>
Error Contents: HTTP Error 405: Method Not Allowed
Traceback (most recent call last):
Reply
#9
That's unrelated. The site the log uploader uses has been dead for a while.
Reply
#10
Try the kordkutter addon which is a better test for https
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#11
(2016-08-17, 20:04)Memphiz Wrote: This should be fixed in next nightly build.

Not sure if this is already fixed but I have been trying the latest nightlies for OSX for a while now. Using the nightly from yesterday (6th September) the issue still persists. I noticed some changes referenced on the original PR were merged yesterday so I decided to try todays (7th) nightly build. However the Application crashes before starting.
No rush and no pressure at all, just FYI in case this is supposed to be already fixed.

Cheers and thanks for looking into the issue
Reply
#12
stupid bug introduced by the cmake system ... will be solved once this PR is merged:

https://github.com/xbmc/xbmc/pull/10416

Its a coincidence that exactly this bugfix was voided by cmake ...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#13
It's working great again on latest nightlies! Thanks to Memphiz, fetzerch, FernetMenta and everyone else involved.
Marking the thread as solved
Reply

Logout Mark Read Team Forum Stats Members Help
Kodi 17 Krypton - SSL issues0