pub struct SecurityConfig { /* private fields */ }Expand description
Security configuration used to communicate with a service.
Implementations§
Source§impl SecurityConfig
impl SecurityConfig
Sourcepub fn ca_file(&self) -> Option<&Path>
pub fn ca_file(&self) -> Option<&Path>
The path to a file containing PEM-formatted root certificates trusted to identify the service.
These certificates are used in addition to the bundled root CA list.
Sourcepub fn key_file(&self) -> Option<&Path>
pub fn key_file(&self) -> Option<&Path>
The path to a file containing a PEM-formatted private key used for client certificate authentication.
This key is expected to match the leaf certificate in Self::cert_file.
Sourcepub fn cert_file(&self) -> Option<&Path>
pub fn cert_file(&self) -> Option<&Path>
The path to a file containing PEM-formatted certificates used for client certificate authentication.
The file should start with the leaf certificate corresponding to the key in Self::key_file, and the contain
the remainder of the certificate chain to a trusted root.
Sourcepub fn pinned_certs(&self) -> &[String]
pub fn pinned_certs(&self) -> &[String]
PEM-formatted leaf certificates to pin against, one PEM document per entry.
When non-empty, the client will only consider a TLS connection valid if the server’s end-entity certificate
matches one of the certificates in this list. The certificate chain itself is not validated against any
trust anchor; pinning the leaf is sufficient to identify the server. This is intended as an escape hatch for
environments whose CA hierarchy uses X.509 features (e.g. directoryName name constraints, see
RFC 5280 §4.2.1.10) that the underlying
TLS library does not support.
Because the chain is skipped, the configured certificates must be rotated in lockstep with the server’s leaf certificate. Operators that enable this option should ensure they have a process to keep the pins up to date, or service traffic will fail when the server’s certificate is renewed.
Trait Implementations§
Source§impl Clone for SecurityConfig
impl Clone for SecurityConfig
Source§fn clone(&self) -> SecurityConfig
fn clone(&self) -> SecurityConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityConfig
impl Debug for SecurityConfig
Source§impl Default for SecurityConfig
impl Default for SecurityConfig
Source§fn default() -> SecurityConfig
fn default() -> SecurityConfig
Source§impl<'de> Deserialize<'de> for SecurityConfig
impl<'de> Deserialize<'de> for SecurityConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SecurityConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SecurityConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Hash for SecurityConfig
impl Hash for SecurityConfig
Source§impl PartialEq for SecurityConfig
impl PartialEq for SecurityConfig
Source§fn eq(&self, other: &SecurityConfig) -> bool
fn eq(&self, other: &SecurityConfig) -> bool
self and other values to be equal, and is used by ==.impl Eq for SecurityConfig
impl StructuralPartialEq for SecurityConfig
Auto Trait Implementations§
impl Freeze for SecurityConfig
impl RefUnwindSafe for SecurityConfig
impl Send for SecurityConfig
impl Sync for SecurityConfig
impl Unpin for SecurityConfig
impl UnsafeUnpin for SecurityConfig
impl UnwindSafe for SecurityConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.