Skip to content

channel

Functions

  • build_channel - Build a lazily connecting tonic channel to the Authority.

firma_sidecar::authority_client::channel::build_channel

Section titled “firma_sidecar::authority_client::channel::build_channel”

Function

Build a lazily connecting tonic channel to the Authority.

  • ca_cert_pem — PEM CA cert to verify the Authority’s server TLS cert. Required when url uses https://.
  • client_cert_pem / client_key_pem — PEM client cert + key for mTLS. Both must be Some or both None. Used when the Authority requires client certificates (mtls_client_ca_cert_path is set on the Authority).

Returns an error if the URL cannot be parsed, TLS configuration is invalid, or an https:// URL is provided without a CA certificate.

fn build_channel(url: &str, connect_timeout: std::time::Duration, ca_cert_pem: Option<&[u8]>, client_cert_pem: Option<&[u8]>, client_key_pem: Option<&[u8]>) -> anyhow::Result<tonic::transport::Channel>