pub struct PeerClientVerifierBuilder { /* private fields */ }Expand description
Builds a PeerClientVerifier: PeerClientVerifier::builder, the policy and the
addresses, then build.
Implementations§
Source§impl PeerClientVerifierBuilder
impl PeerClientVerifierBuilder
Sourcepub fn policy(self, policy: Policy) -> Self
pub fn policy(self, policy: Policy) -> Self
The policy the verifier decides under. Default Policy::default.
Sourcepub fn addresses(self, source: SocketAddr, local: SocketAddr) -> Self
pub fn addresses(self, source: SocketAddr, local: SocketAddr) -> Self
The addresses of one connection, from source to local, for a host whose
connections reach rustls without this crate’s accept helpers, such as quinn, which runs
the verifier on threads of its own.
Waiting entries are recorded under source. With the acl feature, a policy’s access
control list is applied to the certificate’s fingerprint from these addresses before
the pins or the store are consulted (Refusal::PeerDenied), so a denied client is
never recorded as waiting. The list’s address rules are not applied here; a host checks
them before the handshake with Policy::admits_address, or uses
ServerConfigs::for_connection, which applies
both. Without addresses, a verifier reads the scope the accept helpers set.
Sourcepub fn build(self) -> Result<Arc<dyn ClientCertVerifier>, PeerError>
pub fn build(self) -> Result<Arc<dyn ClientCertVerifier>, PeerError>
The verifier.
§Errors
PeerError::Unsupported for Roots and
PinnedOrRoots, which only clients apply;
PeerError::CaFile / PeerError::TrustPattern when the CA file or globs
are unusable; PeerError::Policy when a pin uses a digest the policy refuses, the
policy cannot build a crypto provider, a rule of its access control list names something
that is not a SHA-256 peer id, or it has an access control list and no addresses were
given: a verifier without addresses cannot apply one, so it is refused rather than
ignored.