[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
- 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. - 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). - 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 variablePIP_CERT. - 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. - 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_hubshows which version you have. - 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:
- Set up and maintain ComfyUI on Windows
Desktop or Portable, where the models belong, sharing models with other programs, safely installing custom nodes, updates, startup options … - Your First Image with ComfyUI
Install Comfy Desktop, learn the interface, and create your first AI image with FLUX.2 [small] 4B or Z-Image Turbo. - Your First AI Video with LTX in ComfyUI
Use LTX-2.3 in ComfyUI to create short videos with sound from text or an image. Template, files, settings, and license.
Terms for this
Similar errors
- Hugging Face: 429 Client Error: Too Many Requests / We had to rate limit you – too many requests, you’re being throttled
- ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied – pip cannot modify a file
- 'python' is not recognized or opens the Microsoft Store
- ImportError: DLL load failed while importing …: The specified module could not be found – a Python package is missing a Windows DLL
- No matching distribution found for torch (wrong Python version)
Sources
- https://pip.pypa.io/en/stable/topics/https-certificates/
- https://requests.readthedocs.io/en/latest/user/advanced/
- https://www.python-httpx.org/environment_variables/
- https://github.com/huggingface/huggingface_hub/releases/tag/v2.0.0
Checked on Oct 27, 2026. Didn't help? Ask in the forum and name the graphics card, program, and the full message.