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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
truststore-0.1.0.tar.gz
(8.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file truststore-0.1.0.tar.gz.
File metadata
- Download URL: truststore-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07810f7234d21cf7d4124cca3195f39a766ee94f7d18c73b8e66f5ec845e96b5
|
|
| MD5 |
0d6a9a973b4fb7b1c4a300a59e969e46
|
|
| BLAKE2b-256 |
8ff2c0e18d733147aa00a53a3aad04545691282faf6e306c27998591b023e710
|
File details
Details for the file truststore-0.1.0-py3-none-any.whl.
File metadata
- Download URL: truststore-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using 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
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e94e0b8f49ba74870d06522092f1304edbf10303bdcd9b0763be90872cd45ec1
|
|
| MD5 |
621ab2c44a60af9a03d2e420edfadf5f
|
|
| BLAKE2b-256 |
158c3725583ee243105b14b9003d36314f4a0fa81c1e87012bd49272d35e263b
|