#[non_exhaustive]pub enum TlsError {
Io(ErrorKind),
Handshake(String),
BadCert(String),
InvalidConfig(String),
CertRevoked(String),
CertInvalid(String),
ProtocolViolation(String),
AlertReceived(AlertDescription),
Other(String),
}Expand description
Errors that can occur during TLS operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Io(ErrorKind)
An I/O error occurred, identified by its kind.
Handshake(String)
A TLS handshake error.
BadCert(String)
An invalid or unacceptable certificate.
InvalidConfig(String)
The TLS configuration is invalid.
CertRevoked(String)
A certificate has been revoked (CRL or OCSP).
CertInvalid(String)
A certificate is invalid (e.g. bad signature, malformed DER, expired).
ProtocolViolation(String)
The remote peer violated the TLS protocol.
AlertReceived(AlertDescription)
A TLS alert was received from the peer.
Other(String)
Any other TLS error.
Implementations§
Source§impl TlsError
impl TlsError
Sourcepub fn is_handshake(&self) -> bool
pub fn is_handshake(&self) -> bool
Returns true if this is a handshake error.
Sourcepub fn is_protocol_violation(&self) -> bool
pub fn is_protocol_violation(&self) -> bool
Returns true if this is a protocol-violation error.
Trait Implementations§
Source§impl Error for TlsError
impl Error for TlsError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
impl StructuralPartialEq for TlsError
Auto Trait Implementations§
impl Freeze for TlsError
impl RefUnwindSafe for TlsError
impl Send for TlsError
impl Sync for TlsError
impl Unpin for TlsError
impl UnsafeUnpin for TlsError
impl UnwindSafe for TlsError
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