Fix Python CERTIFICATE_VERIFY_FAILED errors when connecting to Chainstack nodes. Update certifi, install macOS certificates, or use a certifi-aware SSL context.
TLDR:
Python’s CERTIFICATE_VERIFY_FAILED errors happen when your system can’t chain the server’s certificate back to a trusted root.
The safe fix is to update your system’s CA certificates — install certifi, or run Install Certificates.command on macOS.
Disabling SSL verification works as a development-only workaround but should never ship to production.
When a Python HTTP client connects to your Chainstack endpoint over HTTPS, it validates the server’s TLS certificate by chaining it back to a trusted root certificate authority. If your system’s CA bundle is outdated or missing, you’ll see errors like:
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate
These workarounds disable certificate validation. Use only for local debugging — never in production. Skipping verification makes your connection vulnerable to man-in-the-middle attacks.