Skip to main content

Crate uselesskey_tonic

Crate uselesskey_tonic 

Source
Expand description

Integration between uselesskey X.509 fixtures and tonic transport TLS types.

This crate provides extension traits that convert uselesskey certificates and chains into tonic::transport::{Identity, Certificate, ServerTlsConfig, ClientTlsConfig}.

§Features

  • x509 (default) - X.509 certificates and chain support

§Example

use uselesskey_core::Factory;
use uselesskey_x509::{ChainSpec, X509FactoryExt};
use uselesskey_tonic::{TonicClientTlsExt, TonicServerTlsExt};

let fx = Factory::random();
let chain = fx.x509_chain("grpc-service", ChainSpec::new("test.example.com"));

let server_tls = chain.server_tls_config_tonic();
let client_tls = chain.client_tls_config_tonic("test.example.com");

Traits§

TonicClientTlsExt
Build tonic::transport::ClientTlsConfig from uselesskey fixtures.
TonicIdentityExt
Convert uselesskey fixtures into tonic::transport::Identity.
TonicMtlsExt
Build mutual TLS (mTLS) configs from X.509 chains.
TonicServerTlsExt
Build tonic::transport::ServerTlsConfig from uselesskey fixtures.