Access OS Root Certificates

2.0.6 · active · verified Sat Apr 11

wassima is a Python library designed to simplify access to your operating system's root certificates, aiming to provide similar ease of use as `certifi` but leveraging the system's native trust store. It is currently at version 2.0.6 and maintains an active release cadence, primarily for bug fixes and updates to its embedded CA bundle.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to obtain an `ssl.SSLContext` object configured with your operating system's root certificates using `wassima.trust_manager()`. This context can then be passed to HTTP clients for secure communication.

import ssl
from wassima import trust_manager

# Get an SSLContext configured with system trust store
# This context can be used with HTTP clients like `requests` or `httpx`.
context: ssl.SSLContext = trust_manager()

print(f"SSLContext type: {type(context)}")
print(f"Context protocol: {context.protocol}")

# You can optionally inspect loaded certificates (example):
# for cert in context.get_ca_certs():
#     print(f"  Loaded CA: {cert.subject.rfc4514_string()}")

# Example usage with `requests` (if installed):
# import requests
# try:
#     response = requests.get("https://example.com", verify=context)
#     print(f"Request to example.com successful: {response.status_code}")
# except Exception as e:
#     print(f"Request failed: {e}")

view raw JSON →