-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Python] Latest update breaks https/ssl #4137
Comments
@hgy59 May you please help about it. |
Getting a similar error except on the Python3 package. Not actually with Sickbeard, but rather with a different Python-dependent piece of software.
Python 3.7.7-12, DS920+, DSM 6.2.3-25426 Update 2. |
Same problem accessing AWS S3 with python3 boto package. I read it could happen with older versions of boto because it lacked SNI support, but I also tried with latest version. So if it's a generic problem it could be related with the CA bundle file packaged with some python package |
Has nothing to do with Python but with the applications written in python and website who do a changeover from optional to mandatory ssl verification. In the past on a lot of websites this verification was not mandatory. |
Hi BenjV, Thanks for your reply. Could you then please explain why it starts working again with the previous python package installed? |
That is because in older versions of python the ssl verification was not mandatory and ssl errors were just ignored So the problem is two fold, the website are changing and now reply with ssl errors if detected and python is not longer ignoring those errors. In other words that applicatie is a security risk and not compatible with the latest python version. But this is still not an SynoCommunity issue, the Python 2 package just installs the latest Python version. |
To "fix" the problem you need to specify a ca bundle file containing the CA that issued the server cert you are trying to connect. |
This has nothing to do with this issue. The log file states that the application is trying to use "http" and both sites are "https only" at this moment. By the way, Sickbeard is a really old fork and is no longer maintained for years now. |
@BenjV I think in this case the problem is that the certificates are not being correctly picked up in the new packages.. |
Hmm ... I used the Url from the error message posted by @blueflame2020 :
Then I checked the python version and got this:
While the package center tells me I have python 2.7.18-23 |
Could you try with a httpS URL? And indeed with the right package :) |
I stand corrected, I started the wrong python which is included with DSM.
and for https:
|
If I use requests with a certificate file from certifi all is working OK.
And surprise surprise this also works because requests because requests automatically uses certifi
So conclusion: |
Can confirm the same happening on the Python 3 version.
|
If you start python on the commandline and give the following commands you see a list where ssl is looking for a certificate
So I have two solutions and a one workaround for this issue. Solution 2:
Workaround:
My preference would be solution 2, which could also be used as a workaround for users as long as the package is not changed. |
I think the previous packages used solution 1 and used the general DSM certificate store. I remember inspecting this long ago and it sort of worked out of the box that it looked in the right location. But can't find much of a reference to it now. |
Other ideas...
Solution 4) Use More info on this:
|
@th0ma7 The certifi package is included in the Python package as site-package so it is already present and a simlink to the cacert.pem of that certifi package is in my opinion the best solution. That way everything is included in the Python package and not dependent on system certificates, which could change. |
The previous version (Python 2.7.14 (default, May 28 2018, 14:47:18)) where everything worked has this:
And if I understand you correctly, the new version lacks this file right? |
Correct, the latest package does not include a certificate in that location. I did some investigation and the reason that normally a python release does and should not distribute a certificate is that certificates expires. Actually an application that uses ssl should include a certificate and keep it up-to-date. |
I have another solution.
Make sure that the task is run as root!!!! |
@BenjV I would actually use both... so at install time you do have an updated |
Agree, but until the python package is changed, everybody could use the wget command to get everything working for now. |
Copying the file cert.pem back after update (and chmod 644 the file) does resolve the SSL: CERTIFICATE_VERIFY_FAILED errors, so thank you for that @BenjV ! Unfortunately the other issue is not resolved with this. (sickbeard unable to run in https mode with self signed or own generated certificates also not after adding the CA and intermediate certs to the server.crt file for sickbeard (cert first, then intermediate, then root) and the CA cert to the certs.pem file.) @th0ma7 I tried your workaround B before opening this issue but I could not get this to work. (added it to the startup script of sickbeard at /var/packages/sickbeard-custom/scripts/service-setup) P.s. the script should look like:
p.s.2: the fork that I use is kinda still maintained: https://github.com/junalmeida/Sick-Beard |
Sickbeard is just not made for https access. And the wget command I supplied was already the correct one, yours is simply an alias. |
If you put yours in a script, the file will also contain all github http stuff ;) And lets agree to disagree on https for local applications ;) |
No I tested mine and it just pulls only the one file so you probably made a mistake. |
Content of file (first ten lines):
So, what am I doing wrong here? |
Apparently I did something wrong. So your link is the correct one and I have change mine. Sorry. |
Package updates have been published with fix #4192. Please confirm and close if relevant |
Not trying to be obnoxious but what exactly do you want us to check? Synology package showing no update available for Home Assistant from SynCommunity. Or manual upgrade through CLI? Thanks in advance for clarifying! |
There is a new Python2 package available (Version 2.7.18-24) in the synocommunity package center. This should fix #4177 (related to home assistant). |
Can this fix be included in the Python3 package? I only had that one installed for Home Assistant. I tried installin the one you refer above but does not fix the issue. |
hg59 made a mistake. You have to grab Python 3 package update
|
Same error on my end
|
This has nothing to do with the issue of this topic. You have a problem in your own environment, most likely you have put a self signed certificate in the system certificate path. You can find that path by issueing this command on the Openssl prompt:
|
I consider it as fixed. |
For new Package Requests, see the guidelines
Setup
Package Name: Python/SickBeard Custom
Package Version: 2.7.18-23/20200804-8
NAS Model: DS415+
NAS Architecture: Intel Atom C2538 (Avoton)
DSM version: DSM 6.2.3-25426 Update 2
Expected behavior
After upgrade to latest python version:
Sickbeard shuold work like previous python version (2.7.14-19)
Sickbeard should open when https is enabled and browsing to https://<NAS_IP>:8083
Sickbeard should be able to connect to tvdb and venomous.github.io/sb_tvdb_scene_exceptions/exceptions.txt without
errors.
Actual behavior
SickBeard web page does not show.
Chrome reports "The connection was reset." when going directly to https://<NAS_IP>:8083
NGINX proxy server shows:
Sickbeard does run. (service is started and running and the logs show startup and backlog entries indicating processing of files etc. is continuing.)
On stopping SickBeard via package center, disabling https in the config.ini file and starting SickBeard again, the webpage is reachable at http://NAS_IP>:8083 (but in plain text, without certificates).
This is the case with both SickBeard self signed certificates as with own valid certificates.
Sickbeard can't search new series because connection to tvdb fails with ssl error.
Steps to reproduce
1. Previous versions of python and latest version of sickbeard installed and configured with own valid certificate or self signed certificate (https enabled)
2. Update Python package via package center
3. login to sickbeard and search for a show.
Package log
Check Package Center or
/usr/local/{package}/var/
Sickbeard install log:
Other logs
No log entries in Logs/cherrypy.log after enabling weblogs via config.ini and https is enabled.
Log entry in Logs/sickbeard.log
and
The text was updated successfully, but these errors were encountered: