Page 2 of 2
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 10:35 am
by eydaimon
I checked the certificate with Chrome and it appears to be OK
Are you sure this is the issue? Or is the https cert different from SSL cert?
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 1:10 pm
by shypike
It depends on whether Chrome uses its own root certificate store
or uses the one provided by the operating system.
Python uses the latter.
Try this tiny Python program:
Code: Select all
#!/usr/bin/python
import urllib2
x = urllib2.urlopen("https://YOUR_URL")
print x
An alternative is to use an older Python version, like 2.5 or 2.6.
Often Unix systems have multiple versions installed.
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 1:15 pm
by eydaimon
Code: Select all
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
OK, so what you said is obviously correct.
May I suggest for SABnzbd a couple of things then. First, stop retrying when this is the issue, and second post a message to the user that there's an SSL cert failure, and to contact the provider as a possible solution to fix the issue.
Sound reasonable?
Since it sounds like the fix may take some time, I'll do as you suggest and see about using 2.6 in the meantime while also contacting the provider.
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 1:20 pm
by eydaimon
Looks like my options are python2.7 or python3.x
You didn't suggest python 3.x so it doesn't work I assume?
Code: Select all
python2-2_3
python27-2.7.9
python3-3_3
python32-3.2.5_12
python33-3.3.5_5
python34-3.4.3
and python2 is just an alias to python 2.7
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 1:26 pm
by eydaimon
Installing 2.6.9 with
https://github.com/yyuu/pyenv
seems easy enough
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 2:46 pm
by shypike
eydaimon wrote:Code: Select all
urllib2.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)>
May I suggest for SABnzbd a couple of things then. First, stop retrying when this is the issue, and second post a message to the user that there's an SSL cert failure, and to contact the provider as a possible solution to fix the issue.
Sound reasonable?
Not that reasonable, since the first line of trouble is in the feedparser.py code, a complicated third-party animal.
The problem that the Python people change the default behaviour overnight.
(And of course that some sites use bad certificates, or at least ones with less-than-general acceptance.)
I'll do my best to come up with a solution, although disabling security mechanisms is that good an idea
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 2:56 pm
by sander
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 4:06 pm
by shypike
Does that also cover RSS feeds?
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 4:11 pm
by sander
shypike wrote:
Does that also cover RSS feeds?
IIRC: Yes. As it all started with nzbindex.nl versus nzindex.com RSS
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 18th, 2015, 6:12 pm
by eydaimon
FYI using youtube_dl on the freebsd machine gives me the same error, whereas using youtube_dl on osx with the same version of python does not. ANy idea why that would make a difference?
note: they on the other hand have a --no-check-certificate flag which means I can still use it. But this makes me think it's OS specific
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 19th, 2015, 3:34 am
by shypike
eydaimon wrote:FYI using youtube_dl on the freebsd machine gives me the same error, whereas using youtube_dl on osx with the same version of python does not. ANy idea why that would make a difference?
It's specific for Python 2.7.
9, no earlier version verifies certificates.
OSX doesn't have it. For Windows only the "original" Python, but not the popular ActiveState Python.
Only very recent Linux/Unix distros have it.
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 19th, 2015, 12:05 pm
by eydaimon
For now I used Sanders hack (Thank you Sanders!)
And just put
Code: Select all
opt_out_of_certificate_verification = True
if opt_out_of_certificate_verification:
try:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
except:
pass
in the beginning of SABnzbd.py
Re: WAIT xx secs - Trying to fetch... on ALL from several si
Posted: March 19th, 2015, 4:33 pm
by shypike
Ok, I'll look at it again as soon as I have my Ubuntu Vivid up and running.