OK, so this is getting messy.
These are all python links on the system:
Code: Select all
[/] # find -type l -name python
./mnt/ext/opt/Python/bin/python
./share/CACHEDEV1_DATA/.qpkg/container-station/bin/python
./share/CACHEDEV1_DATA/.qpkg/container-station/usr/local/python/bin/python
./share/CACHEDEV1_DATA/.qpkg/SABnzbdplus/Repository/lib/python
./share/CACHEDEV1_DATA/.qpkg/SABnzbdplus/x86/bin-utils/python
./share/CACHEDEV1_DATA/.qpkg/SickBeard-TVRage/Repository/lib/python
./share/CACHEDEV1_DATA/.qpkg/XBMC/bin/python
./share/CACHEDEV1_DATA/.qpkg/GoogleCloudStorage/python/bin/python
./share/CACHEDEV1_DATA/.qpkg/CloudLink/python/bin/python
./share/CACHEDEV1_DATA/.qpkg/CloudDrive/python/bin/python
find: File system loop detected; ‘./share/CACHEDEV1_DATA/.qpkg/HD_Station/share/CACHEDEV1_DATA’ is part of the same file system loop as ‘./share/CACHEDEV1_DATA’.
./share/CACHEDEV1_DATA/.qpkg/HD_Station/usr/bin/python
./usr/local/python
./usr/local/bin/python
./usr/bin/python
And files:
Code: Select all
[/] # find -type f -name python
./share/CACHEDEV1_DATA/.qpkg/Python/bin/python
./share/CACHEDEV1_DATA/.qpkg/QKVM/opt/bin/python
find: File system loop detected; ‘./share/CACHEDEV1_DATA/.qpkg/HD_Station/share/CACHEDEV1_DATA’ is part of the same file system loop as ‘./share/CACHEDEV1_DATA’.
./share/CACHEDEV1_DATA/.qpkg/HD_Station/usr/share/bash-completion/completions/python
./share/CACHEDEV1_DATA/.qpkg/HD_Station/usr/share/lintian/overrides/python
Then:
[/] # which python
/share/CACHEDEV1_DATA/.qpkg/container-station/bin/python
[/] # /share/CACHEDEV1_DATA/.qpkg/container-station/bin/python
Python 2.7.3 (default, Aug 18 2015, 01:08:10)
[GCC 4.9.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
The one visible in the UI (and installed as a dependency of Sabnzbd QNAP "official" package) claims that it is 2.7.3 in the name of the package, but that's apparently not true:
[/] # /share/CACHEDEV1_DATA/.qpkg/Python/bin/python
Python 2.7.9 (default, Mar 24 2015, 00:42:24)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Which explains why I see this in Sabnzbd setup page:
Code: Select all
Python Version: 2.7.9 (default, Mar 24 2015, 00:42:24) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
So finally your script.
2.7.9:
[~] # /share/CACHEDEV1_DATA/.qpkg/Python/bin/python http-https-tester.py
Python version 2.7.9 (default, Mar 24 2015, 00:42:24)
[GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
URL
http://www.google.com/ OK, with result <!doctype html><html itemscope="" itemtype="
http://schema.org/WebPage" lang="cs"><head><meta content
URL
https://www.google.com/ not OK, with error <class 'urllib2.URLError'>
URL
http://api.nzbgeek.info/api?t=get&id=xxx&apikey=yy not OK, with error <class 'urllib2.URLError'>
URL
https://api.nzbgeek.info/api?t=get&id=xxx&apikey=yy not OK, with error <class 'urllib2.URLError'>
URL
https://tv.eurosport.nl/ not OK, with error <class 'urllib2.URLError'>
URL
http://does.not.exist/ not OK, with error <class 'urllib2.URLError'>
URL
https://nzbindex.com/ not OK, with error <class 'urllib2.URLError'>
URL
https://raw.githubusercontent.com/ not OK, with error <class 'urllib2.URLError'>
Finished
2.7.3
[~] # /share/CACHEDEV1_DATA/.qpkg/container-station/bin/python http-https-tester.py
Python version 2.7.3 (default, Aug 18 2015, 01:08:10)
[GCC 4.9.1]
URL
http://www.google.com/ OK, with result <!doctype html><html itemscope="" itemtype="
http://schema.org/WebPage" lang="cs"><head><meta content
URL
https://www.google.com/ OK, with result <!doctype html><html itemscope="" itemtype="
http://schema.org/WebPage" lang="cs"><head><meta content
URL
http://api.nzbgeek.info/api?t=get&id=xxx&apikey=yy OK, with result <error code="100" description="Invalid API Key"/>
URL
https://api.nzbgeek.info/api?t=get&id=xxx&apikey=yy OK, with result <error code="100" description="Invalid API Key"/>
URL
https://tv.eurosport.nl/ not OK, with error <class 'ssl.SSLError'>
URL
http://does.not.exist/ not OK, with error <class 'urllib2.URLError'>
URL
https://nzbindex.com/ OK, with result <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd
URL
https://raw.githubusercontent.com/ OK, with result <!DOCTYPE html> <html lang="en" class=""> <head prefix="og:
http://ogp.me/ns# fb:
http://ogp.me/ns
Finished
So the problem is obvious - the Python package installed as Sabnzbd dependency doesn't handle certificates (and my system has too many pythons to my taste, however all is result of installing relatively modest amount of packages through UI).
Install page for QNAP:
http://forum.qnap.com/viewtopic.php?f=133&t=86644