rembo10 / headphones

Automatic music downloader for SABnzbd
GNU General Public License v3.0
3.35k stars 603 forks source link

SSL Error connecting to NZBGeek #3254

Closed Spunky17 closed 1 year ago

Spunky17 commented 3 years ago

Getting the below error when Headphones tries to connect to NZBGeek. I believe this is related to their posting regarding the phase out of older versions of SSL and requiring TLS 1.2 or better.

2020-08-13 09:37:58 ERROR Unable to connect to remote host because of a SSL error. It is likely that your system cannot verify the validity of the certificate. The remote certificate is either self-signed, or the remote server uses SNI. See the wiki for more information on this topic. 2020-08-13 09:37:57 INFO Parsing results from https://api.nzbgeek.info using search term:

The info for NZBGeek is here: https://nzbgeek.info/showthread.php?tid=13138

I believe this could be resolved by upgrading to python3 which seems to be a hot topic here as every time it's mentioned the reply is headphones doesn't support python3 which I get but it seems the need is there if this is going to continue to be a viable application. I really hope that it does cause other apps (Lidarr) just don't seem to cut it since they lack the Musicbrainz integration.

raymondjstone commented 3 years ago

That NZBgeek thread is locked and only available if you have an account.

Have you double checked that your own machine has TLS 1.2 enabled?

This tool is handy for setting it and switching on and off crypto schemes https://www.nartac.com/Products/IISCrypto/

Spunky17 commented 3 years ago

Sorry about that, didn't think of that. Below is a cut and paste from the thread. Also, I have checked my system and confirmed TLS 1.2 is setup and working. My other apps don't have any issue connecting to NZBGeek as they are using new versions of mono and python. Headphones is the only one that I can't move to Python3 due to code errors. When python was updated on my host system I had to edit the Headphones.py to force it back to python2.7 to start up.

Solved: 3 Months, 2 Weeks, 1 Day, 10 Hours, 48 Minutes, 56 Seconds ago 05-01-2020, 07:25 AM (This post was last modified: 12-01-2020, 03:47 AM by jeeves.) If you are getting errors like - cannot establish secure channel - for apps that use the NZBgeek API then your system needs to have TLS (Transport Layer Security) upgraded.

As of Janauary 2020 TLS 1.0 & TLS 1.1 have reached end of life and are no longer supported. NZBgeek only allows SSL communications on TLS 1.2 and above as should all websites in which you have secure communications with.

TLS 1.2 has been out for a long time and there are a small number of geeks who have not kept their systems updated. We are also working towards supporting TLS 1.3 so keeping updated is a good thing.

For the following applications you will need to ensure certain minimums are in place to carry out secure communications:

Sonarr & Radarr Windows operating systems require .NET updated. Linux operating systems require mono updated.

SickRage Python will require updating to support TLS 1.2

SickBeard & CouchPotato Both applications are no longer under development and have not been active for over 3 years. You should consider migrating to any of the other modern applications that are active in development and support.

raymondjstone commented 3 years ago

This may help (or may not depending on how the headphones code does it calls)

https://stackoverflow.com/questions/29153271/sending-tls-1-2-request-in-python-2-6

basically make sure you have 2.7 or later

Spunky17 commented 3 years ago

I read the link above but I am not sure if it will work given that it states that the request library doesn't support the hard setting of the SSL version as noted. Running through a proxy might be an idea but seems overly complicated to support or maintain.

Running Python 2.7.18.

Services using Python 3.8.5 don't have any issues.

sollidius commented 3 years ago

Hi, Were you able to workaround this? I'm getting the same issue (python 2.7.14 on windows). Thanks!

Spunky17 commented 3 years ago

I was able to install two versions of python on my system; 2.7.18 and 3.8.6.

From there I hardcoded the Headphones.py script to use the 2.7 branch by setting the first line in the script to "#!/usr/bin/env python2.7". I'm using FreeBSD so not sure of the notation under Windows.

I did fork the code and have been tinkering with modifying the code to work with newer versions of python but it's not really my thing (python coding) and I've been doing a lot of reading and not much changing of code.

rembo10 commented 1 year ago

Now that it's on python 3 it should be resolved. Reopen if not