TLS / mTLS unicast transport for Swarmauri.
Project description
srv_ctx.verify_mode = ssl.CERT_REQUIRED
srv_ctx.load_verify_locations("ca.pem")
cli_ctx = ssl.create_default_context()
cli_ctx.load_cert_chain("cli.pem", "cli.key")
async def main(): server = TlsUnicastTransport(srv_ctx)
async def run_server():
async with server.server(host="0.0.0.0", port=8443):
data = await server.recv()
await server.send("peer", b"tls:" + data)
async def run_client():
client = TlsUnicastTransport(cli_ctx, sni="localhost")
async with client.client(host="127.0.0.1", port=8443):
await client.send("server", b"hello")
response = await client.recv()
print(response.decode())
await asyncio.gather(run_server(), run_client())
asyncio.run(main())
Configure the SSL contexts with your own certificates (and CA trust) to enable
TLS or full mTLS verification.
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
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 swarmauri_transport_tls_unicast-0.11.0.dev1.tar.gz.
File metadata
- Download URL: swarmauri_transport_tls_unicast-0.11.0.dev1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b6e03cc7ed84a6329d19f05878a5771141d0978039a30f089f8f2563ee2814f0
|
|
| MD5 |
67289ceb2a7431814d6dd49158ecc86c
|
|
| BLAKE2b-256 |
c533ee9f01cfec0b9cf15e5bd22b691a9a04178fd003b592984d6f32eb7e8d96
|
File details
Details for the file swarmauri_transport_tls_unicast-0.11.0.dev1-py3-none-any.whl.
File metadata
- Download URL: swarmauri_transport_tls_unicast-0.11.0.dev1-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.26 {"installer":{"name":"uv","version":"0.11.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
43caa8e5c7f5e7ec31394b2ffc1d1bded4316c229ee536dc018abf308fa0b4a0
|
|
| MD5 |
1eb5458cb711e7563df03154bb3ae7ba
|
|
| BLAKE2b-256 |
8353c92c5a2caeb58275d268f784d914d219c6118b87d517e5363035cbb1ab2d
|