Crate spiffe_rustls_tokio

Crate spiffe_rustls_tokio 

Source
Expand description

§spiffe-rustls-tokio

Tokio-native accept/connect helpers for spiffe-rustls configs.

Integrates tokio-rustls with automatic peer SPIFFE ID extraction. Provides TlsAcceptor and TlsConnector that return (TlsStream, PeerIdentity) after successful handshakes. Runtime-agnostic TLS configuration remains in spiffe-rustls.

§Example

use spiffe::X509Source;
use spiffe_rustls::{authorizer, mtls_client};
use spiffe_rustls_tokio::TlsConnector;
use std::sync::Arc;

let source = X509Source::new().await?;
let client_config = mtls_client(source)
    .authorize(authorizer::any())
    .build()?;

let connector = TlsConnector::new(Arc::new(client_config));

Structs§

PeerIdentity
Peer identity extracted from a TLS connection.
TlsAcceptor
A TLS acceptor that extracts peer SPIFFE identity from accepted connections.
TlsConnector
A TLS connector that extracts peer SPIFFE identity from established connections.

Enums§

Error
Errors returned by spiffe-rustls-tokio.