mtls_client

Function mtls_client 

Source
pub fn mtls_client(source: X509Source) -> ClientConfigBuilder
Expand description

Constructor for the mTLS client builder.

Creates a client builder with default settings (accepts any SPIFFE ID, uses all bundles from the Workload API).

ยงExamples

use spiffe_rustls::{authorizer, mtls_client};

let source = spiffe::X509Source::new().await?;

let client_config = mtls_client(source)
    .authorize(authorizer::exact([
        "spiffe://example.org/myservice",
    ])?)
    .build()?;