Thurion / EDSM-RSE-for-EDMC

Elite: Dangerous Star Map - Red Star Eliminator (EDSM-RSE) is a plugin that displays the name and distance to a nearby system, that is on EDSM but is missing coordinates (therefore being displayed as red system)
GNU General Public License v2.0
34 stars 2 forks source link

Certificate failure when retrieving projects #65

Closed traveller42 closed 3 years ago

traveller42 commented 3 years ago

I've been getting the following error for the last few days. (I know it was working on 27 SEP 2021 at 2240 US Eastern Time (UTC-4).

`2021-10-02 21:13:23.501 - DEBUG - 216408:213652:213652 .EDSM-RSE.RseData.RseData._query_rse_api:282: Error calling RSE API. Traceback (most recent call last): File "urllib\request.pyc", line 1346, in do_open File "http\client.pyc", line 1257, in request File "http\client.pyc", line 1303, in _send_request File "http\client.pyc", line 1252, in endheaders File "http\client.pyc", line 1012, in _send_output File "http\client.pyc", line 952, in send File "http\client.pyc", line 1426, in connect File "ssl.pyc", line 500, in wrap_socket File "ssl.pyc", line 1040, in _create File "ssl.pyc", line 1309, in do_handshake ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\Users\Clark\AppData\Local\EDMarketConnector\plugins\EDSM-RSE\RseData.py", line 272, in _query_rse_api url = urlopen(rse_url, timeout=10) File "urllib\request.pyc", line 214, in urlopen File "urllib\request.pyc", line 517, in open File "urllib\request.pyc", line 534, in _open File "urllib\request.pyc", line 494, in _call_chain File "urllib\request.pyc", line 1389, in https_open File "urllib\request.pyc", line 1349, in do_open urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)> 2021-10-02 21:13:23.520 - DEBUG - 216408:213652:213652 .EDSM-RSE.RseData.RseData._query_rse_api:283: Tried to call https://cyberlord.de/rse/projects.py. 2021-10-02 21:13:23.521 - ERROR - 216408:213652:213652 .EDSM-RSE.RseData.RseData.initialize:415: Could not get information about projects.`

traveller42 commented 3 years ago

When I access the URL mentioned in the log, I find a Certificate Chain that looks reasonable, so I don't know what certificate is being reported as expired.

traveller42 commented 3 years ago

Adding cafile='/Program Files (x86)/EDMarketConnector/cacert.pem' to all the urlopen calls allows expected operation.

There is a warning about that use of cafile being deprecated in favor of context.

Thurion commented 3 years ago

I changed the code to use requests instead of urllib and pushed it to the development branch (which is the default here on Github).

Can you give it a try, please?

traveller42 commented 3 years ago

Update works as intended.

Thurion commented 3 years ago

I published https://github.com/Thurion/EDSM-RSE-for-EDMC/releases/tag/ver_1.4.1 in case anyone else runs unto the same issue.