pub struct DangerousAnyServerVerifier;Expand description
ServerCertVerifier that accepts any peer certificate. Safe ONLY when
paired with a strong reverse authentication channel — in our case the
peer’s --mtls-allowlist fingerprint-pins our client cert.
§v0.7.0 S6-LOW1 — threat model and compensating control
This verifier is intentionally permissive on the SERVER cert and is the documented compensating-with-mTLS control for issue #224. The security argument has three legs that must all hold for the resulting channel to remain trustworthy:
- Client cert is the actual authn primitive. The peer
fingerprint-pins our client cert via
--mtls-allowlist. A misbehaving server cannot complete the TLS handshake unless our client cert’s SHA-256 is on its allowlist; an attacker who has spoofed DNS but lacks our client key is filtered at the peer’sClientCertVerifier. - Sync traffic is single-purpose. The federation channel only
carries
/api/v1/sync/push+/api/v1/sync/sincepayloads. The receiver still validates every memory throughvalidate::validate_memory, signs/verifies every link through the H3 verify path, and gates every write through the per-agent quota (S6-M2). A man-in-the-middle would gain nothing by impersonating a server we’d already authenticate ourselves to. - Pinning server certs is a v0.8.0 refinement. Layer-2b
server-cert pinning lands when the
--peer-fingerprintflag is added (tracked in #224 follow-up). At that point this verifier is replaced with a fingerprint allowlist-checking variant. Until then, operators are explicitly informed via the operator runbook (docs/runbook/federation-tls.md) that:- both peers MUST set
--mtls-allowlistto fingerprint-pin each other’s CLIENT cert, - server-cert presentation is not currently authenticated beyond TLS handshake completion,
- any deployment that exposes the federation port to a hostile network MUST front the daemon with a reverse proxy that performs server-side cert pinning.
- both peers MUST set
Do not use this verifier outside the federation sync-daemon
path. The MCP / CLI / HTTP-app paths use the default rustls
verifier with platform roots. Removing the Dangerous prefix from
the type name would obscure the trade-off and is rejected.
Trait Implementations§
Source§impl Debug for DangerousAnyServerVerifier
impl Debug for DangerousAnyServerVerifier
Source§impl ServerCertVerifier for DangerousAnyServerVerifier
impl ServerCertVerifier for DangerousAnyServerVerifier
Source§fn verify_server_cert(
&self,
_end_entity: &CertificateDer<'_>,
_intermediates: &[CertificateDer<'_>],
_server_name: &ServerName<'_>,
_ocsp_response: &[u8],
_now: UnixTime,
) -> Result<ServerCertVerified, Error>
fn verify_server_cert( &self, _end_entity: &CertificateDer<'_>, _intermediates: &[CertificateDer<'_>], _server_name: &ServerName<'_>, _ocsp_response: &[u8], _now: UnixTime, ) -> Result<ServerCertVerified, Error>
Verify the end-entity certificate
end_entity is valid for the
hostname dns_name and chains to at least one trust anchor. Read moreSource§fn verify_tls12_signature(
&self,
message: &[u8],
cert: &CertificateDer<'_>,
dss: &DigitallySignedStruct,
) -> Result<HandshakeSignatureValid, Error>
fn verify_tls12_signature( &self, message: &[u8], cert: &CertificateDer<'_>, dss: &DigitallySignedStruct, ) -> Result<HandshakeSignatureValid, Error>
Verify a signature allegedly by the given server certificate. Read more
Source§fn verify_tls13_signature(
&self,
message: &[u8],
cert: &CertificateDer<'_>,
dss: &DigitallySignedStruct,
) -> Result<HandshakeSignatureValid, Error>
fn verify_tls13_signature( &self, message: &[u8], cert: &CertificateDer<'_>, dss: &DigitallySignedStruct, ) -> Result<HandshakeSignatureValid, Error>
Verify a signature allegedly by the given server certificate. Read more
Source§fn supported_verify_schemes(&self) -> Vec<SignatureScheme>
fn supported_verify_schemes(&self) -> Vec<SignatureScheme>
Return the list of SignatureSchemes that this verifier will handle,
in
verify_tls12_signature and verify_tls13_signature calls. Read moreSource§fn requires_raw_public_keys(&self) -> bool
fn requires_raw_public_keys(&self) -> bool
Returns whether this verifier requires raw public keys as defined
in RFC 7250.
Source§fn root_hint_subjects(&self) -> Option<&[DistinguishedName]>
fn root_hint_subjects(&self) -> Option<&[DistinguishedName]>
Return the
DistinguishedNames of certificate authorities that this verifier trusts. Read moreAuto Trait Implementations§
impl Freeze for DangerousAnyServerVerifier
impl RefUnwindSafe for DangerousAnyServerVerifier
impl Send for DangerousAnyServerVerifier
impl Sync for DangerousAnyServerVerifier
impl Unpin for DangerousAnyServerVerifier
impl UnsafeUnpin for DangerousAnyServerVerifier
impl UnwindSafe for DangerousAnyServerVerifier
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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