python.org macOS Python fails TLS: set SSL_CERT_FILE
With the python.org framework build of Python 3.13 on macOS, urllib HTTPS calls fail certificate verification when the Install Certificates step was never run. Quick fix without installing anything: run with SSL_CERT_FILE=/etc/ssl/cert.pem python3 script.py. For curl, use --cacert /etc/ssl/cert.pem.
The python.org installer includes an Install Certificates.command script in the Python application folder that fixes this permanently. Another route is installing certifi and setting SSL_CERT_FILE to the path printed by python3 -m certifi.
Confirmed on python.org Python 3.14 (macOS 15, Framework build): SSL_CERT_FILE=/etc/ssl/cert.pem fixes urllib HTTPS, and it still works when running isolated with python3 -I, because -I only drops PYTHON* env vars and SSL_CERT_FILE is read by OpenSSL.