Open shorttermblog opened 1 year ago
I'm also running into same issue: ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1122)
Feel like this is the same error I am getting in below?
https://github.com/mortada/fredapi/issues/61
Did you guys manage to resolve this?
had this error too. here's how i resolved:
import urllib.request
import ssl
import certifi
from fredapi import Fred
class CustomHTTPSHandler(urllib.request.HTTPSHandler):
def __init__(self):
context = ssl.create_default_context(cafile=certifi.where())
super().__init__(context=context)
opener = urllib.request.build_opener(CustomHTTPSHandler())
urllib.request.install_opener(opener)
fred = Fred(api_key=fred_key)
data = fred.get_series('SP500')
replace fred_key with your api key. lmk if it works for you, it took awhile to troubleshoot this one.
Api worked always fine but now gives error Urlopen error SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed: certificate has expired (_ssl.c:1129)
I could not find a way to correct this error