Skip to main content

SkipVerification

Struct SkipVerification 

Source
struct SkipVerification {
    provider: Arc<CryptoProvider>,
}
Expand description

TLS certificate verifier that skips all verification. Testing only.

Fields§

§provider: Arc<CryptoProvider>

The provider whose signature schemes this verifier advertises.

Held rather than hardcoded because supported_verify_schemes is not a claim about what this verifier checks — it checks nothing — but about what the ClientHello offers. See that method for why the distinction has teeth.

Implementations§

Source§

impl SkipVerification

Source

fn new() -> Self

Use whichever provider this process installed, falling back to the one this crate compiles with.

Taking the installed provider rather than naming ring unconditionally keeps the verifier’s advertised schemes in step with the schemes the rest of the handshake was actually built from, however the embedding binary configured rustls.

Trait Implementations§

Source§

impl Debug for SkipVerification

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ServerCertVerifier for SkipVerification

Source§

fn supported_verify_schemes(&self) -> Vec<SignatureScheme>

Every scheme the active provider can verify.

This looks like dead weight on a verifier that verifies nothing, and it is not: rustls sends this list as the ClientHello’s signature_algorithms extension, so it decides which certificates a server is willing to offer us — before this verifier is consulted at all.

Read off the provider rather than written out by hand, because a hand-written list omits whatever it forgets — ECDSA_NISTP521_SHA512 is the easy one to miss. A relay with a P-521 leaf would then fail a verification-disabled connection because of what this client offered, not because of anything wrong with the relay — and for the conformance probe that consumes this crate, a failure it manufactured itself is the one result it must never record.

The provider’s own list is the floor, so the offer widens whenever the provider’s does. It is not the ceiling, because it cannot be: ring does not implement P-521 at all, so deferring to it alone still leaves that certificate unreachable. That constraint does not apply here — this verifier accepts every certificate without looking at it, so a scheme it could not check is one it never needs to. Advertising a superset is exactly right for a verifier that verifies nothing, and would be wrong for any verifier that does.

Source§

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 more
Source§

fn verify_tls12_signature( &self, _message: &[u8], _cert: &CertificateDer<'_>, _dcs: &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<'_>, _dcs: &DigitallySignedStruct, ) -> Result<HandshakeSignatureValid, Error>

Verify a signature allegedly by the given server certificate. Read more
§

fn requires_raw_public_keys(&self) -> bool

Returns whether this verifier requires raw public keys as defined in RFC 7250.
§

fn root_hint_subjects(&self) -> Option<&[DistinguishedName]>

Return the [DistinguishedName]s of certificate authorities that this verifier trusts. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more