Enum rustls::Error [−][src]
pub enum Error {
Show 23 variants
InappropriateMessage {
expect_types: Vec<ContentType>,
got_type: ContentType,
},
InappropriateHandshakeMessage {
expect_types: Vec<HandshakeType>,
got_type: HandshakeType,
},
CorruptMessage,
CorruptMessagePayload(ContentType),
NoCertificatesPresented,
UnsupportedNameType,
DecryptError,
EncryptError,
PeerIncompatibleError(String),
PeerMisbehavedError(String),
AlertReceived(AlertDescription),
InvalidCertificateEncoding,
InvalidCertificateSignatureType,
InvalidCertificateSignature,
InvalidCertificateData(String),
InvalidSct(Error),
General(String),
FailedToGetCurrentTime,
FailedToGetRandomBytes,
HandshakeNotComplete,
PeerSentOversizedRecord,
NoApplicationProtocol,
BadMaxFragmentSize,
}
Expand description
rustls reports protocol errors using this type.
Variants
We received a TLS message that isn’t valid right now.
expect_types
lists the message types we can expect right now.
got_type
is the type we found. This error is typically
caused by a buggy TLS stack (the peer or this one), a broken
network, or an attack.
Fields of InappropriateMessage
We received a TLS handshake message that isn’t valid right now.
expect_types
lists the handshake message types we can expect
right now. got_type
is the type we found.
Fields of InappropriateHandshakeMessage
expect_types: Vec<HandshakeType>
Which handshake type we expected
got_type: HandshakeType
What handshake type we received
The peer sent us a syntactically incorrect TLS message.
CorruptMessagePayload(ContentType)
The peer sent us a TLS message with invalid contents.
Tuple Fields of CorruptMessagePayload
0: ContentType
The peer didn’t give us any certificates.
The certificate verifier doesn’t support the given type of name.
We couldn’t decrypt a message. This is invariably fatal.
We couldn’t encrypt a message because it was larger than the allowed message size. This should never happen if the application is using valid record sizes.
PeerIncompatibleError(String)
The peer doesn’t support a protocol version/feature we require. The parameter gives a hint as to what version/feature it is.
Tuple Fields of PeerIncompatibleError
0: String
PeerMisbehavedError(String)
The peer deviated from the standard TLS protocol. The parameter gives a hint where.
Tuple Fields of PeerMisbehavedError
0: String
AlertReceived(AlertDescription)
We received a fatal alert. This means the peer is unhappy.
Tuple Fields of AlertReceived
We received an invalidly encoded certificate from the peer.
We received a certificate with invalid signature type.
We received a certificate with invalid signature.
InvalidCertificateData(String)
We received a certificate which includes invalid data.
Tuple Fields of InvalidCertificateData
0: String
InvalidSct(Error)
The presented SCT(s) were invalid.
Tuple Fields of InvalidSct
0: Error
General(String)
A catch-all error for unlikely errors.
Tuple Fields of General
0: String
We failed to figure out what time it currently is.
We failed to acquire random bytes from the system.
This function doesn’t work until the TLS handshake is complete.
The peer sent an oversized record/fragment.
An incoming connection did not support any known application protocol.
The max_fragment_size
value supplied in configuration was too small,
or too large.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Error
impl UnwindSafe for Error
Blanket Implementations
Mutably borrows from an owned value. Read more