Skip to main content
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.

The error

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:

Update certifi (all OSes)

The certifi package ships Mozilla’s CA bundle for Python. Updating it covers most cases:
If you use requests, urllib, aiohttp, or httpx, they pick up the updated bundle automatically the next time they construct a default SSL context.

Install Certificates (macOS only)

Python installers on macOS don’t always install the system certificates. Run the bundled installer:
  1. Open Spotlight (Cmd + Space).
  2. Type Install Certificates.command and run it.
This installs certifi’s CA bundle into the Python you launched.

Explicit certifi-aware context

If updating certifi alone doesn’t take effect, build the SSL context explicitly:

Development-only workarounds

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.

Unverified ssl context

Override the default HTTPS context

requests with verify=False

See also

Last modified on May 19, 2026