#[non_exhaustive]pub enum AlertDescription {
Show 28 variants
CloseNotify,
UnexpectedMessage,
BadRecordMac,
RecordOverflow,
HandshakeFailure,
BadCertificate,
UnsupportedCertificate,
CertificateRevoked,
CertificateExpired,
CertificateUnknown,
IllegalParameter,
UnknownCa,
AccessDenied,
DecodeError,
DecryptError,
ProtocolVersion,
InsufficientSecurity,
InternalError,
InappropriateFallback,
UserCanceled,
MissingExtension,
UnsupportedExtension,
UnrecognizedName,
BadCertificateStatusResponse,
UnknownPskIdentity,
CertificateRequired,
NoApplicationProtocol,
Unknown(u8),
}Expand description
A TLS alert description code (RFC 8446 §6).
The Unknown(u8) catch-all carries any code not listed in RFC 8446,
allowing the type to remain forwards-compatible without breaking consumers.
§Examples
use oxitls_core::AlertDescription;
let d = AlertDescription::from(40u8);
assert_eq!(d, AlertDescription::HandshakeFailure);
assert_eq!(d.to_u8(), 40);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CloseNotify
close_notify (0) — orderly TLS shutdown.
UnexpectedMessage
unexpected_message (10) — inappropriate message received.
BadRecordMac
bad_record_mac (20) — record authentication failure.
RecordOverflow
record_overflow (22) — TLSCiphertext record too long.
HandshakeFailure
handshake_failure (40) — unable to negotiate acceptable security parameters.
BadCertificate
bad_certificate (42) — unacceptable certificate.
UnsupportedCertificate
unsupported_certificate (43) — certificate type not supported.
CertificateRevoked
certificate_revoked (44) — certificate has been revoked.
CertificateExpired
certificate_expired (45) — certificate has expired.
CertificateUnknown
certificate_unknown (46) — unspecified certificate problem.
IllegalParameter
illegal_parameter (47) — field in the handshake was out of range or inconsistent.
UnknownCa
unknown_ca (48) — certificate’s CA is not trusted.
AccessDenied
access_denied (49) — valid certificate, but access control denied.
DecodeError
decode_error (50) — unable to decode a message.
DecryptError
decrypt_error (51) — handshake cryptographic operation failed.
ProtocolVersion
protocol_version (70) — protocol version not supported.
InsufficientSecurity
insufficient_security (71) — server requires ciphers more secure than those supported by client.
InternalError
internal_error (80) — internal error unrelated to the peer or correctness of the protocol.
InappropriateFallback
inappropriate_fallback (86) — TLS_FALLBACK_SCSV in response to version downgrade.
UserCanceled
user_canceled (90) — handshake is being canceled for a reason unrelated to a protocol failure.
MissingExtension
missing_extension (109) — negotiated extension was missing from the ClientHello.
UnsupportedExtension
unsupported_extension (110) — extension not permitted for this message.
UnrecognizedName
unrecognized_name (112) — SNI name not recognized.
BadCertificateStatusResponse
bad_certificate_status_response (113) — OCSP response invalid.
UnknownPskIdentity
unknown_psk_identity (115) — no acceptable PSK identity was supplied.
CertificateRequired
certificate_required (116) — client certificate required.
NoApplicationProtocol
no_application_protocol (120) — no ALPN protocol overlap.
Unknown(u8)
An alert code not listed in RFC 8446.
The wrapped value is the raw numeric alert code.
Implementations§
Trait Implementations§
Source§impl Clone for AlertDescription
impl Clone for AlertDescription
Source§fn clone(&self) -> AlertDescription
fn clone(&self) -> AlertDescription
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 AlertDescription
impl Debug for AlertDescription
Source§impl Display for AlertDescription
impl Display for AlertDescription
Source§impl From<u8> for AlertDescription
impl From<u8> for AlertDescription
Source§impl PartialEq for AlertDescription
impl PartialEq for AlertDescription
Source§fn eq(&self, other: &AlertDescription) -> bool
fn eq(&self, other: &AlertDescription) -> bool
self and other values to be equal, and is used by ==.