requests.exceptions.SSLError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
This requests error means Python couldn’t verify the server’s SSL certificate against its trusted CA bundle. I originally “fixed” it with verify=False. Don’t do that: it turns off certificate verification entirely and leaves the request open to a man-in-the-middle. The error almost always has a real, fixable cause.
If the certificate is signed by an internal or self-signed CA (common for corporate and intranet services), point requests at that CA instead of turning verification off:
r = s.post(url, data=payload, headers=headers, verify="/path/to/internal-ca.pem")
A corporate SSL-inspection proxy re-signs traffic with its own root, and the fix is the same: pass that root CA to verify. If the CA bundle is just out of date, requests verifies against certifi, so pip install --upgrade certifi (or updating your OS CA certs) often clears it. If the server is missing its intermediate certificate, that’s a server-side misconfiguration you can confirm with SSL Labs and fix in the chain.
If you genuinely need to skip verification for a throwaway local test, scope it and silence the warning knowingly, never against anything real:
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
r = s.post(url, ..., verify=False) # local debugging only