#[non_exhaustive]pub enum Error {
Show 22 variants
InappropriateMessage {
expect_types: Vec<ContentType>,
got_type: ContentType,
},
InappropriateHandshakeMessage {
expect_types: Vec<HandshakeType>,
got_type: HandshakeType,
},
InvalidEncryptedClientHello(EncryptedClientHelloError),
InvalidMessage(InvalidMessage),
NoCertificatesPresented,
UnsupportedNameType,
DecryptError,
EncryptError,
PeerIncompatible(PeerIncompatible),
PeerMisbehaved(PeerMisbehaved),
AlertReceived(AlertDescription),
InvalidCertificate(CertificateError),
InvalidCertRevocationList(CertRevocationListError),
General(String),
FailedToGetCurrentTime,
FailedToGetRandomBytes,
HandshakeNotComplete,
PeerSentOversizedRecord,
NoApplicationProtocol,
BadMaxFragmentSize,
InconsistentKeys(InconsistentKeys),
Other(OtherError),
}展开描述
rustls 使用此类型报告协议错误。
变体 (Non-exhaustive)§
This enum is marked as non-exhaustive
InappropriateMessage
We received 一个 TLS message that isn’t valid right now.
expect_types lists the message types we can expect right now.
got_type 是 type we found. This error is typically
caused by 一个 buggy TLS stack (the peer 或 this one), 一个 broken
network, 或 an attack.
InappropriateHandshakeMessage
We received 一个 TLS handshake message that isn’t valid right now.
expect_types lists the handshake message types we can expect
right now. got_type 是 type we found.
InvalidEncryptedClientHello(EncryptedClientHelloError)
An error occurred while handling Encrypted Client Hello (ECH)。
InvalidMessage(InvalidMessage)
此 peer sent us 一个 TLS message with invalid contents.
NoCertificatesPresented
此 peer didn’t give us any 证书
UnsupportedNameType
此 certificate verifier doesn’t support the given type of name.
DecryptError
We couldn’t decrypt 一个 message. This is invariably fatal.
EncryptError
We couldn’t encrypt 一个 message because it was larger than the allowed message size. This should never happen if the application is using valid record sizes.
PeerIncompatible(PeerIncompatible)
此 peer doesn’t support 一个 protocol version/feature we require. 此 parameter gives 一个 hint as 到 what version/feature it is.
PeerMisbehaved(PeerMisbehaved)
此 peer deviated 从 标准 TLS protocol. 此 parameter gives 一个 hint where.
AlertReceived(AlertDescription)
We received 一个 fatal 警报,则为 true。 This means the peer is unhappy.
InvalidCertificate(CertificateError)
We saw an invalid certificate.
此 contained error is 从 证书 validation trait implementation.
InvalidCertRevocationList(CertRevocationListError)
提供的证书回消名单(CRL)无效。
General(String)
A catch-all error 用于 unlikely errors.
FailedToGetCurrentTime
We failed 到 figure out what time it currently is.
FailedToGetRandomBytes
We failed 到 acquire random bytes 从 the system.
HandshakeNotComplete
å¨ TLS æ¡æå®æä¹åï¼æ¤å½æ°æ æ³ä½ç¨ã
PeerSentOversizedRecord
此 peer sent an oversized record/fragment.
NoApplicationProtocol
进来的连接不支持任何已知的应用协议。
BadMaxFragmentSize
此 max_fragment_size value supplied in configuration was too small,
或 too large.
InconsistentKeys(InconsistentKeys)
Specific failure cases 从 keys_match 或 一个 crate::crypto::signer::SigningKey that cannot produce 一个 corresponding 公钥.
Other(OtherError)
Any other error.
This variant should only be 用 when the error is not better described by 一个 more specific variant. For example, if 一个 custom crypto provider returns 一个 provider specific error.
Enums holding this variant will never compare equal 到 each other.
Trait 实现§
Source§impl Error for Error
Available on crate feature std only.
impl Error for Error
std only.Source§impl From<CertRevocationListError> for Error
impl From<CertRevocationListError> for Error
Source§fn from(e: CertRevocationListError) -> Self
fn from(e: CertRevocationListError) -> Self
Source§impl From<CertificateError> for Error
impl From<CertificateError> for Error
Source§fn from(e: CertificateError) -> Self
fn from(e: CertificateError) -> Self
Source§impl From<EncryptedClientHelloError> for Error
impl From<EncryptedClientHelloError> for Error
Source§fn from(e: EncryptedClientHelloError) -> Self
fn from(e: EncryptedClientHelloError) -> Self
Source§impl From<GetRandomFailed> for Error
impl From<GetRandomFailed> for Error
Source§fn from(_: GetRandomFailed) -> Self
fn from(_: GetRandomFailed) -> Self
Source§impl From<InconsistentKeys> for Error
impl From<InconsistentKeys> for Error
Source§fn from(e: InconsistentKeys) -> Self
fn from(e: InconsistentKeys) -> Self
Source§impl From<InvalidMessage> for Error
impl From<InvalidMessage> for Error
Source§fn from(e: InvalidMessage) -> Self
fn from(e: InvalidMessage) -> Self
Source§impl From<OtherError> for Error
impl From<OtherError> for Error
Source§fn from(value: OtherError) -> Self
fn from(value: OtherError) -> Self
Source§impl From<PeerIncompatible> for Error
impl From<PeerIncompatible> for Error
Source§fn from(e: PeerIncompatible) -> Self
fn from(e: PeerIncompatible) -> Self
Source§impl From<PeerMisbehaved> for Error
impl From<PeerMisbehaved> for Error
Source§fn from(e: PeerMisbehaved) -> Self
fn from(e: PeerMisbehaved) -> Self
Source§impl From<SystemTimeError> for Error
Available on crate feature std only.
impl From<SystemTimeError> for Error
std only.