Truststore
Verify certificates using OS trust stores. Supports macOS, Windows, and Linux (with OpenSSL). This project should be considered experimental.
Usage
# The following code works on Linux and macOS without other dependencies.
import socket
from truststore import TruststoreSSLContext
sock = socket.create_connection(("example.com", 443))
ctx = TruststoreSSLContext()
sock = ctx.wrap_socket(sock, server_hostname="example.com")
# Also works with libraries that accept an SSLContext object
import urllib3
http = urllib3.PoolManager(ssl_context=ctx)
http.request("GET", "https://example.com")
import aiohttp
http = aiohttp.ClientSession()
await http.request("GET", "https://example.com", ssl=ctx)
Platforms
Works in the following configurations:
- macOS 10.8+ using Python 3.10+ (via Security framework)
- Linux using any Python version
Prior art
- PEP 543: A Unified TLS API for Python
- Experimental APIs in Python 3.10 and the future of trust stores
License
MIT
Metadata
Release files for truststore 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| truststore-0.1.0.tar.gz | 8.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| truststore-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / truststore-0.1.0.tar.gz
| Download URL | truststore-0.1.0.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07810f7234d21cf7d4124cca3195f39a766ee94f7d18c73b8e66f5ec845e96b5
|
|
BLAKE2b-256 checksum How to use checksums |
8ff2c0e18d733147aa00a53a3aad04545691282faf6e306c27998591b023e710
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0rc1
|
Release files / truststore-0.1.0-py3-none-any.whl
| Download URL | truststore-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e94e0b8f49ba74870d06522092f1304edbf10303bdcd9b0763be90872cd45ec1
|
|
BLAKE2b-256 checksum How to use checksums |
158c3725583ee243105b14b9003d36314f4a0fa81c1e87012bd49272d35e263b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.0rc1
|