Skip to main content

Truststore

PyPI CI

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, macOS, and Windows without dependencies.
import socket
import ssl
import truststore

# Create an SSLContext for the system trust store
ctx = truststore.SSLContext(ssl.PROTOCOL_TLS_CLIENT)

# Connect to the peer and initiate a TLS handshake
sock = socket.create_connection(("example.com", 443))
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")

# Works with ssl.MemoryBIO objects for async I/O
import aiohttp

http = aiohttp.ClientSession()
await http.request("GET", "https://example.com", ssl=ctx)

Platforms

Works in the following configurations:

Prior art

License

MIT

Metadata

Release files for truststore 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for truststore 0.4.0
File Size Uploaded
truststore-0.4.0.tar.gz 11.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for truststore 0.4.0
File Interpreter ABI Platform
truststore-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.4 kB

Release files / truststore-0.4.0.tar.gz

Download URL truststore-0.4.0.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
acf60559fda45368f48f98a174568d8fc9b8597faccfaa25f243a4acd48ad13d
BLAKE2b-256 checksum
How to use checksums
a1130eb608e658e2c97840b598fe11c2fdef8e62550486db9d5398ee26150773
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release files / truststore-0.4.0-py3-none-any.whl

Download URL truststore-0.4.0-py3-none-any.whl
Size 12.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
018f261a13c970eb814ac424db4a48d538310416ddad4231ca49033c210eb5cf
BLAKE2b-256 checksum
How to use checksums
2f6595ce2bd157d42e620a4af3f7c9f4ff34a862ac413a8f60e0a4a9ef924c3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.0 CPython/3.9.12

Release history Release notifications | RSS feed

0.10.4

2 release files

0.10.3

2 release files

0.10.0

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page