pub struct QuicServerAuth { /* private fields */ }Expand description
How a QUIC client authenticates the channel to the server it dials.
§This is channel auth, not identity auth
Peer identity (“which node is this”) is established at the application
layer — every response is a signed COSE SignedEnvelope verified against
the peer’s published keys (the DID-doc #mesh verification method / JWKS).
That works identically on native and in WASM, because it is our code, not the
browser’s TLS stack. This type only decides how the TLS channel is
authenticated (confidentiality + anti-active-MITM); it is defence in depth,
not the trust root (#185).
Channel auth is a small lattice of independent requirements, not a fixed set of modes, so it is a validated struct rather than an enum of combinations:
require_web_pki— the leaf must chain to a system-trusted CA and matchserver_name(public peers, dialed by hostname).accept_cert_hashes— a set of acceptable leaf-cert SHA-256s. A set (not one hash) so cert rotation can overlap ({current, next}) and load-balanced endpoints with distinct certs work. The resolver / DID doc supplies these — they are directory-distributed pins, not trust-on-first- use. (For browsers this is the only knob the WebTransport API exposes.)
The verifier ANDs the active requirements. At least one must be active —
{web_pki: false, hashes: []} is no auth and is rejected at construction.
RFC 7250 raw-public-key binding (bind the channel to the published key directly, so native QUIC reuses the identity key instead of a cert hash) is tracked in #200; it is channel hygiene, not an identity requirement (identity is app-layer regardless). iroh already does it natively.
Implementations§
Source§impl QuicServerAuth
impl QuicServerAuth
Sourcepub fn pinned(hashes: Vec<[u8; 32]>) -> Result<Self>
pub fn pinned(hashes: Vec<[u8; 32]>) -> Result<Self>
Pin the leaf cert to one of hashes (SHA-256), no CA requirement — the
self-signed internal-mesh model. Errors if hashes is empty.
Sourcepub fn web_pki_pinned(hashes: Vec<[u8; 32]>) -> Result<Self>
pub fn web_pki_pinned(hashes: Vec<[u8; 32]>) -> Result<Self>
WebPKI validation and the leaf must be one of hashes — defence in
depth against CA mis-issuance (HPKP-style). Errors if hashes is empty.
Sourcepub fn require_web_pki(&self) -> bool
pub fn require_web_pki(&self) -> bool
Whether CA-chain validation is required.
Sourcepub fn accept_cert_hashes(&self) -> &[[u8; 32]]
pub fn accept_cert_hashes(&self) -> &[[u8; 32]]
The set of accepted leaf-cert SHA-256 pins (empty => no pin requirement).
Trait Implementations§
Source§impl Clone for QuicServerAuth
impl Clone for QuicServerAuth
Source§fn clone(&self) -> QuicServerAuth
fn clone(&self) -> QuicServerAuth
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuicServerAuth
impl Debug for QuicServerAuth
Source§impl PartialEq for QuicServerAuth
impl PartialEq for QuicServerAuth
Source§fn eq(&self, other: &QuicServerAuth) -> bool
fn eq(&self, other: &QuicServerAuth) -> bool
self and other values to be equal, and is used by ==.impl Eq for QuicServerAuth
impl StructuralPartialEq for QuicServerAuth
Auto Trait Implementations§
impl Freeze for QuicServerAuth
impl RefUnwindSafe for QuicServerAuth
impl Send for QuicServerAuth
impl Sync for QuicServerAuth
impl Unpin for QuicServerAuth
impl UnsafeUnpin for QuicServerAuth
impl UnwindSafe for QuicServerAuth
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more