rustls_letsencrypt/
error.rs1use std::{io, net::AddrParseError};
2
3use thiserror::Error;
4
5pub type Result<T, E = Error> = std::result::Result<T, E>;
6
7#[derive(Debug, Error)]
8pub enum Error {
9 #[error("the port-443 ALPN handler has not been registered")]
10 AlpnHandlerNotRegistered,
11 #[error("the port-443 ALPN handler is still initializing")]
12 AlpnHandlerNotReady,
13 #[error("an ALPN handler is already registered")]
14 AlpnHandlerAlreadyRegistered,
15 #[error("challenge listener is unavailable")]
16 ChallengeListenerUnavailable,
17 #[error("listener must bind port 443 (bound port: {0})")]
18 InvalidAlpnPort(u16),
19 #[error("invalid configuration: {0}")]
20 InvalidConfig(String),
21 #[error("invalid DNS name: {0}")]
22 InvalidDnsName(String),
23 #[error("hostname is not allowed: {0}")]
24 HostNotAllowed(String),
25 #[error("TLS ClientHello did not include SNI")]
26 MissingSni,
27 #[error("ClientHello timed out")]
28 ClientHelloTimeout,
29 #[error("TLS handshake timed out")]
30 HandshakeTimeout,
31 #[error("certificate issuance timed out for {0}")]
32 IssuanceTimeout(String),
33 #[error("no usable certificate for {0}")]
34 NoCertificate(String),
35 #[error("certificate validation failed: {0}")]
36 Certificate(String),
37 #[error("local CA validation failed: {0}")]
38 LocalCa(String),
39 #[error("ACME failed: {0}")]
40 Acme(String),
41 #[error("managed Pebble executable was not found: {0}")]
42 PebbleExecutableNotFound(String),
43 #[error("managed Pebble address is already in use: {0}")]
44 PebbleAddressInUse(String),
45 #[error("DNS ownership check failed for {host}; resolved {resolved:?}")]
46 DnsOwnershipMismatch { host: String, resolved: Vec<std::net::IpAddr> },
47 #[error("event subscriber lagged and lost {0} events")]
48 EventLagged(u64),
49 #[error(transparent)]
50 Store(#[from] StoreError),
51 #[error(transparent)]
52 Io(#[from] io::Error),
53 #[error(transparent)]
54 Addr(#[from] AddrParseError),
55 #[error("TLS error: {0}")]
56 Tls(String),
57}
58
59#[derive(Debug, Error)]
60pub enum StoreError {
61 #[error("store I/O failed: {0}")]
62 Io(#[from] io::Error),
63 #[error("store serialization failed: {0}")]
64 Serialization(#[from] serde_json::Error),
65 #[error("store record is corrupt: {0}")]
66 Corrupt(String),
67 #[error("store compare-and-swap conflict")]
68 Conflict,
69 #[error("store is read-only")]
70 ReadOnly,
71 #[error("store operation is unsupported: {0}")]
72 Unsupported(&'static str),
73}