1use core::fmt;
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4pub enum Error {
5 InvalidConfiguration,
6
7 InsufficientBuffer,
9 RecordOverflow,
10 UnexpectedAlert {
11 level: u8,
12 description: u8,
13 },
14 ConnectionClosed,
15
16 DecodeError,
18 EncodeError,
19 UnsupportedCipherSuite,
20 UnsupportedKeyExchangeGroup,
21
22 HandshakeDone,
24 UnexpectedMessage,
25 HandshakeFailure,
26 HandshakeAborted {
27 level: u8,
28 description: u8,
29 },
30 InvalidSignature,
31 TranscriptMismatch,
32
33 CertificateEmptyChain,
36 CertificateServerNameRequired,
38 CertificateSubjectNameMismatch,
40 CertificateEndEntityMustNotBeCa,
42 CertificateEkuDoesNotIncludeServerAuth,
44 CertificateIntermediateNotCa,
46 CertificateIssuerSubjectDnMismatch,
48 CertificateSignatureVerificationFailed,
50 CertificateNotYetValid,
52 CertificateExpired,
54 CertificateNoTrustedRootFound {
56 searched_roots: usize,
57 },
58 CertificateNoRootFoundBySpkiMatching,
60 CertificateParseFailed,
62 CertificateEmptyRawPublicKey,
64 CertificateUnsupportedSignatureAlgorithm,
66 CertificateClockMissing,
70
71 CryptoError,
73 AeadError,
74
75 NotEstablished,
77}
78
79impl fmt::Display for Error {
80 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
81 write!(f, "{self:?}")
82 }
83}
84
85#[cfg(feature = "std")]
86impl std::error::Error for Error {}