[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain

Solved it. It wasn’t urllib to blame, it was httpx. I put the following into my environment variables in a wrapper before I ran my python and I’m in business.

export SSL_CERT_FILE=/etc/pki/ca-trust/extracted/pem/ca-bundle.pem
export REQUESTS_CA_BUNDLE=/etc/pki/ca-trust/extracted/pem/ca-bundle.pem

2 Likes