trustme
#1 quality TLS certs while you wait, for the discerning tester
What it is and what it does
trustme is a lightweight Python package that creates fake certificate authorities and issues TLS certificates signed by them, specifically for testing network code. Instead of disabling certificate validation in tests (which masks production bugs), you use trustme to generate realistic test certificates that your test suite can trust, letting you validate the full TLS handshake without real certificates.
The package works both programmatically (creating CA and cert objects in Python) and from the command line (generating PEM files for use in non-Python test suites). It depends on cryptography for the underlying certificate operations and idna for domain name handling. The generated certificates are real certificates, just signed by your test CA rather than a trusted root authority.
Use it for:
- Test a Python web client or server that makes HTTPS connections without disabling certificate validation.
- Generate test certificates for use in non-Python test suites (e.g., shell scripts, Docker containers) via command-line or PEM files.
- Validate that your application correctly handles certificate chains and trust validation logic.
- Create temporary certificate files for libraries that require cert paths rather than SSL context objects.
- Test TLS error handling by issuing certs for different hostnames than the server is configured for.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
trustme generates fake TLS certificates and certificate authorities for testing network code without needing real certificates or disabling certificate validation in tests.
Yes. trustme is a focused, well-maintained tool for a common testing need: validating TLS code without real certificates. Low install friction, permissive license, no known vulnerabilities, and active maintenance make it a safe choice for test suites. Install it if you test any code that makes HTTPS connections.
Install
trustme on PyPI
pip
pip install trustmeuv
uv add trustmepoetry
poetry add trustmeInstalling trustme
Before you install
Low install friction: pure Python wheel with only two runtime dependencies (cryptography and idna). Actively maintained with a recent release on 2025-01-02 and ongoing repository activity.
License in practice
Dual-licensed under MIT or Apache 2.0 (your choice), both permissive. You can use this freely in commercial or proprietary projects with minimal restrictions.
Quickstart
pip install trustme
import trustme
ca = trustme.CA()
server_cert = ca.issue_cert("test-host.example.org")
ca.configure_trust(ssl_context)
server_cert.configure_cert(ssl_context)
Requires Python 3.9 or later.
Verify before relying
- Whether the package works with both standard library ssl and PyOpenSSL contexts as claimed in the description.
- Performance characteristics when generating many certificates in a single test suite.
- Exact certificate format and standards compliance of generated certificates.
Package facts
| License | MIT OR Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — cryptography, idna |
| Maintenance | actively maintained — 589 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,063,092/month — #4,419 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: trustme-1.2.1-py3-none-any.whl
Tags
More Testing packages
Pluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
virtualenvvirtualenv creates isolated Python environments…
permissive · top 100 on PyPI
coverageCoverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
pytest-asynciopytest-asyncio is a pytest plugin that enables…
permissive · top 1,000 on PyPI
pytest-json-ctrfA pytest plugin that generates test reports in…
permissive · top 1,000 on PyPI
certifi-linuxRedirects certifi's certificate lookup to use…
permissive · top 15,000 on PyPI
certipyCertipy creates and manages certificate…
permissive · top 15,000 on PyPI
django-sslserverProvides an SSL-enabled development server for…
permissive · top 15,000 on PyPI
certifiCertifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
wincertstoreAccesses Windows system certificate stores (CA…
permissive · top 15,000 on PyPI
python-certifi-win32Patches certifi at runtime to include…
permissive · top 15,000 on PyPI
pemParses and splits PEM files (Base64-encoded DER…
permissive · top 5,000 on PyPI
acmeImplements the ACME protocol to automate…
permissive · top 5,000 on PyPI
secure-smtplibProvides secure SMTP subclasses with TLS/SSL…
unclear · top 15,000 on PyPI
stcrestclientProvides a Python ReST API client library and…
permissive · top 15,000 on PyPI