Forums

certificate verify failed: certificate has expired

Python Anywhere,

I just started the "hacker" level of membership for some of the practical projects in my Python boot camp. One of these projects tracks whether it's after sunset over certain coordinates using sunrise-sunset API (https://sunrise-sunset.org/api) and then uses open-notify API to find where the ISS Overhead is and check whether it is passing over a certain set of coordinates.

In my tasks, the project runs just fine, as evidenced by the task log. If I try to run the program in a bash console (python3 filenamehere.py), I get the following error message:

requests.exceptions.SSLError: HTTPSConnectionPool(host='api.sunrise-sunset.org', port=443): Max retries exceeded with url: /json?lat%3A=57.47669&lng=-4.23145&formatted=0 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1129)')))

I'm an inexperienced programmer - I hope the term "boot camp" gives away as much - and don't entirely understand what's going on here. Please advise!

西方的獭

Certificate for api.sunrise-sunset.org expired on Sat, 16 Apr 2022 02:28:24 GMT

They need to renew it