Expand description
TLS / mTLS helpers for inter-service gRPC.
Cognitora speaks gRPC across hosts and uses mutual TLS for everything
that crosses a network boundary. This crate exposes a couple of small
helpers built on top of rustls and tonic:
load_identity– read a PEM cert + key into a tonicIdentity.server_tls– assemble a tonicServerTlsConfigrequiring mTLS.client_tls– assemble a tonicClientTlsConfigagainst a CA.generate_dev_pki– bootstrap a self-signed CA + leaf forcgn-ctl pki.
Structs§
- DevPki
- Output of
generate_dev_pki.
Functions§
- client_
tls - Client-side TLS config that trusts
ca_pathand presentscert/key. - generate_
dev_ pki - Generate a self-signed CA + a leaf cert valid for
subject_alt_names, returning PEM bytes for(ca_cert, ca_key, leaf_cert, leaf_key). - load_
identity - Load a PEM-encoded certificate + private key from disk.
- server_
tls - Server-side TLS config requiring client certs (mTLS).