#[non_exhaustive]
#[repr(u8)]
pub enum AlertDescription {
Show 27 variants CloseNotify = 0, UnexpectedMessage = 10, BadRecordMac = 20, RecordOverflow = 22, HandshakeFailure = 40, BadCertificate = 42, UnsupportedCertificate = 43, CertificateRevoked = 44, CertificateExpired = 45, CertificateUnknown = 46, IllegalParameter = 47, UnknownCa = 48, AccessDenied = 49, DecodeError = 50, DecryptError = 51, ProtocolVersion = 70, InsufficientSecurity = 71, InternalError = 80, InappropriateFallback = 86, UserCanceled = 90, MissingExtension = 109, UnsupportedExtension = 110, UnrecognizedName = 112, BadCertificateStatusResponse = 113, UnknownPskIdentity = 115, CertificateRequired = 116, NoApplicationProtocol = 120,
}
Expand description

Alert description.

References

enum {
    close_notify(0),
    unexpected_message(10),
    bad_record_mac(20),
    record_overflow(22),
    handshake_failure(40),
    bad_certificate(42),
    unsupported_certificate(43),
    certificate_revoked(44),
    certificate_expired(45),
    certificate_unknown(46),
    illegal_parameter(47),
    unknown_ca(48),
    access_denied(49),
    decode_error(50),
    decrypt_error(51),
    protocol_version(70),
    insufficient_security(71),
    internal_error(80),
    inappropriate_fallback(86),
    user_canceled(90),
    missing_extension(109),
    unsupported_extension(110),
    unrecognized_name(112),
    bad_certificate_status_response(113),
    unknown_psk_identity(115),
    certificate_required(116),
    no_application_protocol(120),
    (255)
} AlertDescription;

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.
§

CloseNotify = 0

This alert notifies the recipient that the sender will not send any more messages on this connection. Any data received after a closure alert has been received MUST be ignored.

§

UnexpectedMessage = 10

An inappropriate message (e.g., the wrong handshake message, premature Application Data, etc.) was received. This alert should never be observed in communication between proper implementations.

§

BadRecordMac = 20

This alert is returned if a record is received which cannot be deprotected. Because AEAD algorithms combine decryption and verification, and also to avoid side-channel attacks, this alert is used for all deprotection failures. This alert should never be observed in communication between proper implementations, except when messages were corrupted in the network.

§

RecordOverflow = 22

A TLSCiphertext record was received that had a length more than 2^14 + 256 bytes, or a record decrypted to a TLSPlaintext record with more than 2^14 bytes (or some other negotiated limit). This alert should never be observed in communication between proper implementations, except when messages were corrupted in the network.

§

HandshakeFailure = 40

Receipt of a handshake_failure alert message indicates that the sender was unable to negotiate an acceptable set of security parameters given the options available.

§

BadCertificate = 42

A certificate was corrupt, contained signatures that did not verify correctly, etc.

§

UnsupportedCertificate = 43

A certificate was of an unsupported type.

§

CertificateRevoked = 44

A certificate was revoked by its signer.

§

CertificateExpired = 45

A certificate has expired or is not currently valid.

§

CertificateUnknown = 46

Some other (unspecified) issue arose in processing the certificate, rendering it unacceptable.

§

IllegalParameter = 47

A field in the handshake was incorrect or inconsistent with other fields. This alert is used for errors which conform to the formal protocol syntax but are otherwise incorrect.

§

UnknownCa = 48

A valid certificate chain or partial chain was received, but the certificate was not accepted because the CA certificate could not be located or could not be matched with a known trust anchor.

§

AccessDenied = 49

A valid certificate or PSK was received, but when access control was applied, the sender decided not to proceed with negotiation.

§

DecodeError = 50

A message could not be decoded because some field was out of the specified range or the length of the message was incorrect. This alert is used for errors where the message does not conform to the formal protocol syntax. This alert should never be observed in communication between proper implementations, except when messages were corrupted in the network.

§

DecryptError = 51

A handshake (not record layer) cryptographic operation failed, including being unable to correctly verify a signature or validate a Finished message or a PSK binder.

§

ProtocolVersion = 70

The protocol version the peer has attempted to negotiate is recognized but not supported.

§

InsufficientSecurity = 71

Returned instead of handshake_failure when a negotiation has failed specifically because the server requires parameters more secure than those supported by the client.

§

InternalError = 80

An internal error unrelated to the peer or the correctness of the protocol (such as a memory allocation failure) makes it impossible to continue.

§

InappropriateFallback = 86

Sent by a server in response to an invalid connection retry attempt from a client (see RFC 7507).

§

UserCanceled = 90

This alert notifies the recipient that the sender is canceling the handshake for some reason unrelated to a protocol failure. If a user cancels an operation after the handshake is complete, just closing the connection by sending a close_notify is more appropriate. This alert SHOULD be followed by a close_notify. This alert generally has AlertLevel::Warning.

§

MissingExtension = 109

Sent by endpoints that receive a handshake message not containing an extension that is mandatory to send for the offered TLS version or other negotiated parameters.

§

UnsupportedExtension = 110

Sent by endpoints receiving any handshake message containing an extension known to be prohibited for inclusion in the given handshake message, or including any extensions in a ServerHello or Certificate not first offered in the corresponding ClientHello or CertificateRequest.

§

UnrecognizedName = 112

Sent by servers when no server exists identified by the name provided by the client via the server_name extension (see RFC 6066).

§

BadCertificateStatusResponse = 113

Sent by clients when an invalid or unacceptable OCSP response is provided by the server via the status_request extension (see RFC 6066).

§

UnknownPskIdentity = 115

Sent by servers when PSK key establishment is desired but no acceptable PSK identity is provided by the client. Sending this alert is OPTIONAL; servers MAY instead choose to send a decrypt_error alert to merely indicate an invalid PSK identity.

§

CertificateRequired = 116

Sent by servers when a client certificate is desired but none was provided by the client.

§

NoApplicationProtocol = 120

Sent by servers when a client application_layer_protocol_negotiation extension advertises only protocols that the server does not support (see RFC 7301).

Trait Implementations§

source§

impl Clone for AlertDescription

source§

fn clone(&self) -> AlertDescription

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AlertDescription

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Format for AlertDescription

source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
source§

impl From<AlertDescription> for u8

source§

fn from(alert_description: AlertDescription) -> Self

Converts to this type from the input type.
source§

impl PartialEq for AlertDescription

source§

fn eq(&self, other: &AlertDescription) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<u8> for AlertDescription

§

type Error = u8

The type returned in the event of a conversion error.
source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for AlertDescription

source§

impl Eq for AlertDescription

source§

impl StructuralEq for AlertDescription

source§

impl StructuralPartialEq for AlertDescription

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.