pub enum TlsPolicy {
Ca,
Pin(String),
PrivateCa(Vec<CertificateDer<'static>>),
}Expand description
How a client should decide whether to trust the server it reaches.
Variants§
Ca
Standard CA validation against the platform’s trust store.
Pin(String)
Pin the leaf certificate to this SHA-256 (hex of the DER encoding).
PrivateCa(Vec<CertificateDer<'static>>)
Validate against these roots and no others.
Implementations§
Source§impl TlsPolicy
impl TlsPolicy
Sourcepub fn verifies(&self) -> bool
pub fn verifies(&self) -> bool
True when this policy verifies the server’s identity at all.
There is no variant for “do not verify” and there must never be one:
danger_accept_invalid_certs appears nowhere in this workspace, and an
unauthenticated probe is a separate function rather than a policy so it
cannot be selected by accident on a request carrying credentials.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TlsPolicy
impl RefUnwindSafe for TlsPolicy
impl Send for TlsPolicy
impl Sync for TlsPolicy
impl Unpin for TlsPolicy
impl UnsafeUnpin for TlsPolicy
impl UnwindSafe for TlsPolicy
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