pub struct MtlsConfig {
pub cert_path: PathBuf,
pub key_path: PathBuf,
pub ca_cert_path: PathBuf,
}Expand description
mTLS configuration loaded from a directory
Fields§
§cert_path: PathBuf§key_path: PathBuf§ca_cert_path: PathBufImplementations§
Source§impl MtlsConfig
impl MtlsConfig
Sourcepub fn from_dir<P: AsRef<Path>>(dir: P) -> Self
pub fn from_dir<P: AsRef<Path>>(dir: P) -> Self
Load mTLS config from a directory containing cert.pem, key.pem CA cert is loaded from parent directory’s ca-cert.pem
Sourcepub fn from_default_dir() -> Option<Self>
pub fn from_default_dir() -> Option<Self>
Try to load from default ./mtls directory (for gateway)
Sourcepub fn for_service(service_name: &str) -> Option<Self>
pub fn for_service(service_name: &str) -> Option<Self>
Load mTLS config for a specific service from ./mtls/{service_name}/
Sourcepub fn build_server_acceptor(&self) -> Result<TlsAcceptor>
pub fn build_server_acceptor(&self) -> Result<TlsAcceptor>
Build a TLS acceptor for server-side mTLS
Sourcepub fn build_client(&self) -> Result<MtlsClient>
pub fn build_client(&self) -> Result<MtlsClient>
Build an mTLS HTTP client
Trait Implementations§
Source§impl Clone for MtlsConfig
impl Clone for MtlsConfig
Source§fn clone(&self) -> MtlsConfig
fn clone(&self) -> MtlsConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MtlsConfig
impl RefUnwindSafe for MtlsConfig
impl Send for MtlsConfig
impl Sync for MtlsConfig
impl Unpin for MtlsConfig
impl UnsafeUnpin for MtlsConfig
impl UnwindSafe for MtlsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more