JuneStepp / OneLauncher

Launcher and Addons Manager for LOTRO and DDO
Other
45 stars 11 forks source link

Clicking "Find More" on the plugins window produces an error #58

Closed Git-Forked closed 1 month ago

Git-Forked commented 1 month ago
addon_manager - ERROR - [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)
Traceback (most recent call last):
  File "/tmp/onefile_144774_1721876593_640459/urllib/request.py", line 1348, in do_open
  File "/tmp/onefile_144774_1721876593_640459/http/client.py", line 1303, in request
  File "/tmp/onefile_144774_1721876593_640459/http/client.py", line 1349, in _send_request
  File "/tmp/onefile_144774_1721876593_640459/http/client.py", line 1298, in endheaders
  File "/tmp/onefile_144774_1721876593_640459/http/client.py", line 1058, in _send_output
  File "/tmp/onefile_144774_1721876593_640459/http/client.py", line 996, in send
  File "/tmp/onefile_144774_1721876593_640459/http/client.py", line 1475, in connect
  File "/tmp/onefile_144774_1721876593_640459/ssl.py", line 517, in wrap_socket
  File "/tmp/onefile_144774_1721876593_640459/ssl.py", line 1104, in _create
  File "/tmp/onefile_144774_1721876593_640459/ssl.py", line 1382, in do_handshake
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/onefile_144774_1721876593_640459/onelauncher/addon_manager.py", line 1764, in getRemoteAddons
  File "/tmp/onefile_144774_1721876593_640459/urllib/request.py", line 216, in urlopen
  File "/tmp/onefile_144774_1721876593_640459/urllib/request.py", line 519, in open
  File "/tmp/onefile_144774_1721876593_640459/urllib/request.py", line 536, in _open
  File "/tmp/onefile_144774_1721876593_640459/urllib/request.py", line 496, in _call_chain
  File "/tmp/onefile_144774_1721876593_640459/urllib/request.py", line 1391, in https_open
  File "/tmp/onefile_144774_1721876593_640459/urllib/request.py", line 1351, in do_open
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)>
main_window - ERROR - There was a network error. You may want to check your connection.

There is no network trouble. The issue seems to be with an SSL certificate and/or how the program is handling it.

Git-Forked commented 1 month ago

In a python project I created to scrape the lotro website for new weekly codes, I had a similar issue with their SSL certificate and resolved it by:

import urllib3
urllib3.disable_warnings()
urllib3.util.ssl_.DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL'
http = urllib3.PoolManager(cert_reqs='CERT_NONE')

This will allow it to work without verifying the SSL certificate, which worked fine for my scraper, but may not be the best solution for your program, if you are relying on the SSL to send encrypted confidential information like username and password.

JuneStepp commented 1 month ago

I missed that the addon manager is still using outdated networking code that can have this issue in the compiled builds. Will fix soon.

JuneStepp commented 1 month ago

In a python project I created to scrape the lotro website for new weekly codes, I had a similar issue with their SSL certificate and resolved it by:

import urllib3
urllib3.disable_warnings()
urllib3.util.ssl_.DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL'
http = urllib3.PoolManager(cert_reqs='CERT_NONE')

This will allow it to work without verifying the SSL certificate, which worked fine for my scraper, but may not be the best solution for your program, if you are relying on the SSL to send encrypted confidential information like username and password.

Here's the code OneLauncher uses for official game server connections: https://github.com/JuneStepp/OneLauncher/blob/main/src/onelauncher/official_clients.py#L141

There's a bunch of special handling for GLS related stuff that you probably don't care about, but SSL context function I linked might work better than what you have.

JuneStepp commented 1 month ago

In a python project I created to scrape the lotro website for new weekly codes, I had a similar issue with their SSL certificate and resolved it by:

import urllib3
urllib3.disable_warnings()
urllib3.util.ssl_.DEFAULT_CIPHERS += 'HIGH:!DH:!aNULL'
http = urllib3.PoolManager(cert_reqs='CERT_NONE')

This will allow it to work without verifying the SSL certificate, which worked fine for my scraper, but may not be the best solution for your program, if you are relying on the SSL to send encrypted confidential information like username and password.

What exactly are the default ciphers you set for? Do they make a difference when you have the certificate verification disabled?

Git-Forked commented 1 month ago

The default ciphers are set in the hopes that they will correctly work. The certificates are not "disabled", but not required to proceed.

And this line "urllib3.disable_warnings()" disables only the warnings, because in my small program I didn't need to see them. Your program may prefer to correctly handle the warnings and display to the user or be logged.