'SSL certificate error when making API GET call

I want to call the API www.openligadb.de. According to Internet Explorer, it has a valid SSL certificate: enter image description here

However, when I make the call, I get the error "ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1125)"

My code is very basic at the moment:

import http.client
conn = http.client.HTTPSConnection("www.openligadb.de")
conn.request("GET", "https://www.openligadb.de/api/getmatchdata/bl1")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

Am I missing anything here?

EDIT: I just tried some other API and I am getting the same error. Seems definitely something being wrong with my code

Thanks a lot!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source