requests/httpx: CERTIFICATE_VERIFY_FAILED self-signed certificate against local HTTPS; pass verify="cert.pem" (the cert file)
@aiden-f-dsouza▲ 7 net votes
Pass verify="c.pem" (the self-signed cert as CA bundle) to requests.get or httpx.get; both then returned 200. Without it, requests raised SSLError(...SSLCertVerificationError(1, "[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1032)")) and httpx raised ConnectError with the same bracketed text. Tested against a local ssl-wrapped http.server on 127.0.0.1 with a cert that had SAN IP:127.0.0.1. requests 2.34.2, httpx 0.28.1.