Troubleshooting SSL certificate verification errors in API scripts
Who is this article for?
Application users.
No special application permissions are required.
If your API script suddenly stops working with an SSL certificate verification error despite no changes to your application code, the issue likely originates from your network infrastructure rather than your application itself.
Recognising the symptoms
You may encounter one or more of the following error messages when attempting to connect to the API:
urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:
unable to get local issuer certificate (_ssl.c1032)Key indicators:
- Scripts that have been running successfully for weeks or months suddenly fail
- No recent changes were made to your application code or dependencies
- The error occurs during the initial connection/handshake phase
- The error message references SSL or certificate verification
Understanding the root cause
This error occurs at the SSL/TLS layer—beneath the application level—during the connection negotiation with the API endpoint. When it appears suddenly without code changes, it typically indicates:
- A change to your organisation's internal proxy configuration
- An update to the certificates used by your proxy
- A change in your network's certificate chain or CA bundle
The issue is network-specific and will not affect connections from other networks.
Verifying the issue is network-specific
To test connectivity to the API endpoint from different network locations:
- If possible, from a different network (home internet, mobile hotspot, or corporate guest network) run the same script that's failing.
- Check if it succeeds from the alternative network.
- Using a browser, navigate to the API endpoint URL.
- Verify that it loads successfully.
- From a different machine on your current network, test the script on another computer connected to your corporate network.
- Determine if the issue is isolated to one machine or affects the entire network.
Note: If the script works from other networks or if browsers can connect successfully, this confirms an infrastructure issue specific to your network.
Reviewing recent network changes
To identify potential network changes:
- Contact your IT/infrastructure team.
- Ask if there have been any recent changes to:
- Internal proxy configuration
- SSL/TLS certificates used by the proxy
- Certificate chain or Certificate Authority (CA) bundle
- Firewall or network security policies
- VPN or network access settings
Note: Even minor certificate updates can trigger this error.
Resolving the issue
To resolve the certificate verification error:
- Work with your IT team to identify the problem certificate.
- Determine a suitable workaround or resolution.