PlainError

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer cer

Last checked 2026-11-11 · 3 fixes · reviewed answer

TL;DRThis Python error happens when code tries to open a secure HTTPS connection but cannot verify the server's SSL certificate because the local system lacks the root certificate authority that signed it. SSL handles encrypted web connections and the 'local issuer' is the trusted root certificate store on your machine or in the Python environment.

Most likely cause: Python environment missing or using outdated CA certificates (often the certifi package)

Try first: Check default certificate paths (python -c "import ssl; print(ssl.get_default_verify_paths())")

Likely causes

  1. Python environment missing or using outdated CA certificates (often the certifi package)most likely
  2. Corporate proxy, VPN or firewall intercepting traffic without providing a trusted certificatepossible
  3. Remote server presenting an invalid or self-signed certificateless likely

How to fix it

Safest first: SafeChanges settingsDangerous
  1. Check default certificate pathsSafe

    Run this read-only command to see which certificate files Python is currently using.

    python -c "import ssl; print(ssl.get_default_verify_paths())"
  2. Install or upgrade the certifi packageChanges settings

    certifi supplies an up-to-date bundle of root certificates that many Python programs rely on.

    pip install --upgrade certifi
  3. Temporarily point Python at certifi's bundleChanges settings

    Set the SSL_CERT_FILE environment variable to use certifi's certificates for the current command only.

    SSL_CERT_FILE=$(python -c "import certifi; print(certifi.where())") python your_script.py

If that didn't fix it

Temporarily disable verification only for testing by setting the environment variable PYTHONHTTPSVERIFY=0 before running the script and note the security risk.

When to see a technician

Consult a developer or system administrator if this occurs in a corporate network or production environment where certificate policies are centrally managed.

Quick answers

What does ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer cer mean?
This Python error happens when code tries to open a secure HTTPS connection but cannot verify the server's SSL certificate because the local system lacks the root certificate authority that signed it. SSL handles encrypted web connections and the 'local issuer' is the trusted root certificate store on your machine or in the Python environment.
What causes ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer cer?
Python environment missing or using outdated CA certificates (often the certifi package). (most likely) Corporate proxy, VPN or firewall intercepting traffic without providing a trusted certificate. (possible) Remote server presenting an invalid or self-signed certificate. (less likely)
How do I fix ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer cer?
Try these in order, safest first: 1. Check default certificate paths. 2. Install or upgrade the certifi package. 3. Temporarily point Python at certifi's bundle.
What if that didn't fix it?
Temporarily disable verification only for testing by setting the environment variable PYTHONHTTPSVERIFY=0 before running the script and note the security risk.
When should I see a technician?
Consult a developer or system administrator if this occurs in a corporate network or production environment where certificate policies are centrally managed.
Did this fix it? Report a problem

Related errors

All Coding errors →