effective_xgboost_book
effective_xgboost_book copied to clipboard
SSL: CERTIFICATE_VERIFY_FAILED] error and proposed fix
I am getting the following error
URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)>
based on my research it can be fixed by creating the SSL default context and then including the context parameter into the urllib.request.urlopen()
call
import certifi
import ssl
context = ssl.create_default_context(cafile=certifi.where())
fin = urllib.request.urlopen(url, context=context)