#[non_exhaustive]pub enum TlsError {
HandshakeFailed(String),
CertificateValidation(String),
HostnameVerification {
expected: String,
actual: String,
},
InvalidCertificate(String),
InvalidPrivateKey(String),
Configuration(String),
Io(Error),
Rustls(Error),
EncryptionRequired,
EncryptionNotSupported,
StrictModeRequired,
ConnectionClosed,
}Expand description
Errors that can occur during TLS operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HandshakeFailed(String)
TLS handshake failed.
CertificateValidation(String)
Certificate validation failed.
HostnameVerification
Hostname verification failed.
InvalidCertificate(String)
Invalid certificate format.
InvalidPrivateKey(String)
Invalid private key format.
Configuration(String)
TLS configuration error.
Io(Error)
IO error during TLS operations.
Rustls(Error)
Rustls error.
EncryptionRequired
Server requires encryption but client disabled it.
EncryptionNotSupported
Client requires encryption but server doesn’t support it.
StrictModeRequired
TDS 8.0 strict mode is required but not supported.
ConnectionClosed
Connection closed during TLS negotiation.
Implementations§
Source§impl TlsError
impl TlsError
Sourcepub fn is_transient(&self) -> bool
pub fn is_transient(&self) -> bool
Check if this error is transient and may succeed on retry.
IO errors and connection closures are transient. Certificate and configuration errors are terminal.
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Check if this error is terminal and will never succeed on retry.
Certificate validation failures, configuration errors, and encryption mode mismatches are permanent.
Trait Implementations§
Source§impl Error for TlsError
impl Error for TlsError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()