Verify certificates using OS trust stores
Project description
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
import ssl
import truststore
sock = socket.create_connection(("example.com", 443))
ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
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)
- Windows using Python 3.10+ (via CryptoAPI)
- 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
Project details
Release history Release notifications | RSS feed
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.3.0.tar.gz
(11.0 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.3.0.tar.gz.
File metadata
- Download URL: truststore-0.3.0.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5afa72b0b92ca0f74149bd39b6f6e476f4b214692d27502adbbea6e1d36cc93f
|
|
| MD5 |
4084b4cd01de4924fd3c99accf5dfdd1
|
|
| BLAKE2b-256 |
d36cf9df35e13341d58b26f9c32536d93ce1d65f514b7e4feeec1c318a799a94
|
File details
Details for the file truststore-0.3.0-py3-none-any.whl.
File metadata
- Download URL: truststore-0.3.0-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
366e9e15c53b1b343288792000e618e0ac5470d5c7a8d1b5ad5c347ace35d5da
|
|
| MD5 |
b606e6387278e4d1d25d15bc0adaf79c
|
|
| BLAKE2b-256 |
c84997e348d3385df67b500678c83569cb35fa8319074d485ac1ba130333f8ff
|