certifi

2026.2.25 · active · verified Fri Mar 27

certifi provides Mozilla's carefully curated collection of Root Certificates for validating the trustworthiness of SSL certificates while verifying the identity of TLS hosts. Extracted from the Requests project, it exposes a single public API — certifi.where() — returning the filesystem path to the bundled cacert.pem. The current version is 2026.2.25 (versioned by release date). Releases are issued roughly every 1–3 months, tracking Mozilla's own CA store updates.

Warnings

Install

Imports

Quickstart

Use certifi.where() with requests, urllib3, and the stdlib ssl module to pin SSL verification to the bundled Mozilla CA store.

import certifi
import requests
import urllib3
import ssl

# 1. Print the path to the bundled CA bundle
print(certifi.where())  # e.g. /path/to/certifi/cacert.pem

# 2. Pass explicitly to requests (requests uses certifi automatically,
#    but being explicit avoids surprises when REQUESTS_CA_BUNDLE is set)
response = requests.get("https://httpbin.org/get", verify=certifi.where())
print(response.status_code)

# 3. Pass to urllib3 directly
http = urllib3.PoolManager(ca_certs=certifi.where())
r = http.request("GET", "https://httpbin.org/get")
print(r.status)

# 4. Pass to the stdlib ssl module
ctx = ssl.create_default_context(cafile=certifi.where())
print(ctx)

view raw JSON →