Python SSL: CERTIFICATE_VERIFY_FAILEDWhat SSL: CERTIFICATE_VERIFY_FAILED means
The error comes from Python's ssl module during the TLS handshake: the server presented a certificate chain, and Python could not verify it against the trust store it is using. The suffix names the specific failure — "unable to get local issuer certificate" means a CA (usually an intermediate) is missing from your bundle; "certificate has expired" and "self-signed certificate" mean exactly what they say.
Crucially, Python does not automatically use your operating system's trust store in every install. requests ships with certifi, urllib relies on OpenSSL's default paths, and the python.org macOS installer uses neither until you run its certificate install step. Two programs on the same machine can disagree about the same site — which is why the URL works in your browser but fails in your script.
The other big cause class is interception: a corporate firewall, antivirus product, or TLS-inspecting middlebox that terminates your TLS session and re-signs it with its own private CA. Your browser trusts that CA because IT installed it system-wide; the CA bundle Python is using has never heard of it.