pub struct TicketCache { /* private fields */ }Expand description
In-memory ticket cache. Backed by an on-disk JSON blob; load and save are explicit so the rustls wiring layer can drive them at install start / install end.
Implementations§
Source§impl TicketCache
impl TicketCache
Sourcepub fn open(path: impl Into<PathBuf>) -> Self
pub fn open(path: impl Into<PathBuf>) -> Self
Open the cache at the canonical path under
XDG_CACHE_HOME/aube/tls-tickets.json. Caller responsible for
XDG_CACHE_HOME resolution; pass an explicit path here.
Sourcepub fn get(&self, host: &str, port: u16) -> Vec<TicketEntry>
pub fn get(&self, host: &str, port: u16) -> Vec<TicketEntry>
Look up cached tickets for (host, port). Stale entries beyond
MAX_AGE are filtered transparently; callers receive only
fresh tickets.
Sourcepub fn put(&self, host: &str, port: u16, entry: TicketEntry)
pub fn put(&self, host: &str, port: u16, entry: TicketEntry)
Store a fresh ticket for (host, port). Multiple tickets per
origin are kept (rustls servers typically issue 2 per
handshake); prune_max_per_host caps the queue.
Sourcepub fn invalidate(&self, host: &str, port: u16)
pub fn invalidate(&self, host: &str, port: u16)
Evict every ticket for (host, port). Called when a TLS
handshake observes a cert whose SPKI fingerprint does not
match the cached entry — the cert rotated, so the ticket is
stale.
Sourcepub fn save(&self) -> Result<()>
pub fn save(&self) -> Result<()>
Persist the in-memory cache to disk. Atomic via
aube_util::fs_atomic::atomic_write.