Search code examples
python

SSL: CERTIFICATE_VERIFY_FAILED certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))


Working on scripts to connect to AWS and recently started getting this error when I try to install a python module or execute a script I get the following error:

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

It appears I have defined the certificate in the environment path so not sure what else to use to troubleshoot the issue.


Solution

  • Try this in the command line:

    pip install pip-system-certs
    

    I've been struggling with the CERTIFICATE_VERIFY_FAILED error as well when using the requests module. I tried installing certifi but that didn't help. The only solution to my problem was to install pip-system-certs. For some reason that allowed requests to access a local certificate.

    Also: requests.get(url, verify=False) is not recommended for production environment because you basically turn safety off.