pub struct CertStore<E: EntryKey> {
pub by_sni: HashMap<String, Arc<E>>,
pub default: Option<Arc<E>>,
}Expand description
Per-listener cert pool: zero-or-more SNI-keyed entries plus an
optional sni-less default. The default fires when a ClientHello
has no SNI extension or when the SNI does not match any
Self::by_sni key. A listener has at most one default.
Keys in Self::by_sni are stored ASCII-lowercase per RFC 6066
§ 3 (server_name is already ASCII-lowercased by rustls), so
resolver-side lookups are byte-for-byte without an
eq_ignore_ascii_case shim.
Fields§
§by_sni: HashMap<String, Arc<E>>§default: Option<Arc<E>>Implementations§
Source§impl<E: EntryKey> CertStore<E>
impl<E: EntryKey> CertStore<E>
pub fn new() -> Self
Sourcepub fn lookup(&self, sni: Option<&str>) -> Option<Arc<CertifiedKey>>
pub fn lookup(&self, sni: Option<&str>) -> Option<Arc<CertifiedKey>>
Resolve a ClientHello’s SNI against the store. The hot-path
resolver delegates to this so unit tests can exercise the
lookup without constructing a rustls::ClientHello (which is
not user-constructible). sni is expected to already be
ASCII-lowercased by rustls per RFC 6066 § 3.
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for CertStore<E>
impl<E> RefUnwindSafe for CertStore<E>where
E: RefUnwindSafe,
impl<E> Send for CertStore<E>
impl<E> Sync for CertStore<E>
impl<E> Unpin for CertStore<E>
impl<E> UnsafeUnpin for CertStore<E>
impl<E> UnwindSafe for CertStore<E>where
E: RefUnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more