pub type CertificateHook = Arc<dyn Fn(&[Vec<u8>]) + Send + Sync>;Expand description
Called with a certificate chain observed during a handshake, DER, leaf first.
A hook and not a return value because a verifier that is about to reject a certificate has no return path that carries one — it answers with an error, and the bytes it was judging go out of scope. The interesting certificates are exactly the rejected ones, so the observation has to happen where the judging does.
Two things about where it runs. It is called from inside the TLS handshake,
on quinn’s connection driver task rather than on the task that called the
dial, so a hook that blocks stalls the connection and one that panics
unwinds into the driver — keep it to moving bytes somewhere. And
dial_quic calls it once per resolved address it tries, with nothing in
the arguments to say which; a caller that needs to attribute a chain to an
address should dial each one with dial_quic_to.
Aliased Type§
pub struct CertificateHook { /* private fields */ }