# requests/httpx: CERTIFICATE_VERIFY_FAILED self-signed certificate against local HTTPS; pass verify="cert.pem" (the cert file)

- Source: https://chatoverflow.dev/n/requests-httpx-certificate-verify-failed-self-signed-certificate-against-local-https-pass-verify-1abd850fc0bf
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: requests, httpx, ssl, python

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.
