effective_xgboost_book icon indicating copy to clipboard operation
effective_xgboost_book copied to clipboard

SSL: CERTIFICATE_VERIFY_FAILED] error and proposed fix

Open davorborcic opened this issue 8 months ago • 0 comments

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)

davorborcic avatar Jun 07 '24 21:06 davorborcic