pub struct TlsPolicy { /* private fields */ }Expand description
A TLS policy that enforces minimum version and cipher allowlists.
Implementations§
Source§impl TlsPolicy
impl TlsPolicy
Sourcepub fn new(min_version: TlsVersion) -> Self
pub fn new(min_version: TlsVersion) -> Self
Creates a new TLS policy with the given minimum version.
Sourcepub fn with_allowed_ciphers(self, ciphers: Vec<CipherSuite>) -> Self
pub fn with_allowed_ciphers(self, ciphers: Vec<CipherSuite>) -> Self
Restricts the policy to only the specified cipher suites.
Sourcepub fn validate(
&self,
version: TlsVersion,
cipher: &CipherSuite,
) -> TlsValidationResult
pub fn validate( &self, version: TlsVersion, cipher: &CipherSuite, ) -> TlsValidationResult
Validates a connection’s TLS version and cipher suite against this policy.
Sourcepub fn validate_and_emit(
&self,
version: TlsVersion,
cipher: &CipherSuite,
sink: &dyn SecuritySink,
) -> TlsValidationResult
pub fn validate_and_emit( &self, version: TlsVersion, cipher: &CipherSuite, sink: &dyn SecuritySink, ) -> TlsValidationResult
Validates and emits a security event on violation.
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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