Skip to content

Start typing. Errors match on their exact yt-dlp output.

to move, to open esc to close

Fix "CERTIFICATE_VERIFY_FAILED" in yt-dlp

Tested on yt-dlp 2026.07.28 Updated
What yt-dlp prints
ERROR: unable to download webpage: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)>

Quick answer

This is almost never YouTube's fault. Something local cannot verify the certificate chain: an out-of-date trust store, a proxy or antivirus re-signing your traffic, or a system clock that has drifted. Check the clock first — it takes a second and it is the cause more often than anyone expects:

a wrong date invalidates every certificate at once
date

What verification is actually doing

When yt-dlp connects to a site over HTTPS, the site presents a certificate. yt-dlp checks it was signed by an authority it trusts, and that the current time falls inside its validity window. Three separate things can make that fail, and the error text is the same for all three.

The trust store yt-dlp uses is Python's, not your browser's — which is why "it works in Chrome" tells you nothing about this error.

Cause 1 — the clock

A certificate valid from March 2026 to June 2026 fails verification if your machine believes it is 2019. The message says nothing about time. This is common on machines that have been off for months, on virtual machines restored from a snapshot, and on any device with a dead CMOS battery.

Windows
w32tm /resync
macOS and Linux
sudo timedatectl set-ntp true    # systemd
sudo sntp -sS time.apple.com     # macOS

Cause 2 — a stale trust store

Certificate authorities change. A Python install from a few years ago carries a bundle that predates authorities in use today. On macOS specifically, Python from python.org does not use the system store at all and ships a script you have to run once:

macOS, Python from python.org
/Applications/Python\ 3.12/Install\ Certificates.command
any platform, if yt-dlp came from pip
python -m pip install --upgrade certifi

On Linux, refresh the system bundle:

bash
sudo update-ca-certificates      # Debian, Ubuntu
sudo update-ca-trust             # Fedora, RHEL

The standalone yt-dlp binary bundles its own certificates and sidesteps this class of problem entirely — one of several reasons the binary is often the better install.

Cause 3 — something is inspecting your traffic

Corporate proxies, school networks and HTTPS-scanning antivirus all work the same way: they terminate the connection, look inside, and re-sign it with their own certificate. Your browser trusts that certificate because IT installed it into the OS store. Python's bundle has never heard of it.

The correct fix is to give yt-dlp the same certificate, not to turn verification off:

bash
yt-dlp --client-certificate /path/to/corporate-ca.pem "URL"
or point Python's stack at it for the whole session
export SSL_CERT_FILE=/path/to/corporate-ca.pem
yt-dlp "URL"

Confirming the diagnosis

If this succeeds, the connection itself is fine and the trust chain is the whole problem:

bash
yt-dlp --no-check-certificate --simulate "URL"

And this shows you what is actually presenting a certificate — if the issuer is your antivirus or your employer rather than a public authority, cause 3 is confirmed:

bash
openssl s_client -connect www.youtube.com:443 -showcerts < /dev/null 2>/dev/null | openssl x509 -noout -issuer -dates

If it still fails

  • Only on one site. That site's chain may genuinely be misconfigured — a missing intermediate certificate is a real and common server-side mistake. Browsers paper over it by fetching the missing link; Python does not.
  • Only under Docker. Slim base images ship almost no certificates. Add ca-certificates to the image; the Docker guide has a working Dockerfile.
  • Only over a VPN. Some VPN clients install their own root and intercept DNS. Test with it off to confirm.
  • Windows, "unable to get local issuer certificate" on everything. Usually a security suite. Its HTTPS scanning module can be turned off without uninstalling the product.

Frequently asked

Is --no-check-certificate safe?
It is safe from a "will it break something" point of view and unsafe from a security one: it disables the check that proves you are talking to who you think you are. On a corporate network already inspecting your traffic it changes little. On a public network it is exactly what you do not want.
Why does my browser work but yt-dlp does not?
Different trust stores. Firefox ships its own; Chrome uses the OS store; Python — and therefore yt-dlp — uses either the OS store or a bundle installed with certifi, depending on platform and install method. A certificate your browser trusts can be entirely unknown to Python.
How does a wrong clock cause a certificate error?
Certificates carry a validity window. If your system clock says 2019, every current certificate is "not yet valid"; if it says 2030, they have all expired. Both are reported as verification failures with no mention of time.
It only started after I installed antivirus.
Then that is the cause. HTTPS-scanning antivirus terminates TLS and re-signs traffic with its own certificate. Windows installs that certificate into the OS store, which is why the browser is fine — but a Python bundle never sees it.