Free | No tracking | Every fact with a source|German and English

Error / Home and connection

[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate – Python does not trust the certificate (often a company proxy or antivirus)

pip or the Hugging Face download fails because Python cannot verify the HTTPS certificate from the other side.

The message

SSLError: HTTPSConnectionPool(host='huggingface.co', port=443): Max retries exceeded … (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate')))

Affects: Python, Hugging Face (Hub and hf CLI), ComfyUI, TextGen (text-generation-webui)

Why is this happening?

Python tools often use their own list of trusted certificates (certifi) instead of Windows'. If a company proxy or antivirus checks HTTPS connections, it replaces the certificate with its own. Windows knows it, but Python does not. Then verification fails even though the browser works normally.

How to fix it

  1. Find out whether your network checks HTTPS (company proxy, security solution, antivirus with HTTPS inspection). Have the root certificate given to you as a .pem file, for example by your IT team, and save it, for example, under C:\Zertifikate\firma-root.pem.
  2. pip uses the certificates from Windows automatically starting with version 24.2. Check the version with python -m pip --version (ComfyUI portable: .\python_embeded\python.exe -m pip --version).
  3. If pip is older or it still does not work, pass the certificate directly: python -m pip install --upgrade pip --cert C:\Zertifikate\firma-root.pem. You can also make this permanent with the environment variable PIP_CERT.
  4. For programs that download with “requests” (for example older huggingface_hub versions 0.x), set $env:REQUESTS_CA_BUNDLE="C:\Zertifikate\firma-root.pem" in PowerShell before starting. This replaces the normal certificate list used by requests.
  5. huggingface_hub 1.x downloads through httpx. There you set $env:SSL_CERT_FILE="C:\Zertifikate\firma-root.pem". Starting with huggingface_hub 2.0, Windows certificates are used automatically. python -m pip show huggingface_hub shows which version you have.
  6. Start the program in the same terminal where you set the variables, and try the download again.

Better not: Do not turn off certificate verification (for example with verify=False), otherwise anyone on the network can change your downloads unnoticed.

Set up from scratch again

If it still doesn’t work after that, a fresh setup step by step often helps:

Terms for this

Similar errors

Sources

Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.