verify: add Debug bound to ServerCertVerifier

This commit adds a `Debug` bound to the `ServerCertVerifier` trait in
addition to `Send` and `Sync`. Types implementing this trait are updated
to either derive `Debug` or implement it by hand as appropriate.
This commit is contained in:
Daniel McCarney 2023-10-27 12:13:56 -04:00
parent ff86ccf140
commit cc0666e795
5 changed files with 5 additions and 1 deletions

View File

@ -315,6 +315,7 @@ mod danger {
use rustls::client::WebPkiServerVerifier;
use rustls::DigitallySignedStruct;
#[derive(Debug)]
pub struct NoCertificateVerification {}
impl rustls::client::danger::ServerCertVerifier for NoCertificateVerification {

View File

@ -241,6 +241,7 @@ impl server::danger::ClientCertVerifier for DummyClientAuth {
}
}
#[derive(Debug)]
struct DummyServerAuth {}
impl client::danger::ServerCertVerifier for DummyServerAuth {

View File

@ -67,7 +67,7 @@ impl ClientCertVerified {
/// Something that can verify a server certificate chain, and verify
/// signatures made by certificates.
#[allow(unreachable_pub)]
pub trait ServerCertVerifier: Send + Sync {
pub trait ServerCertVerifier: Debug + Send + Sync {
/// Verify the end-entity certificate `end_entity` is valid for the
/// hostname `dns_name` and chains to at least one trust anchor.
///

View File

@ -112,6 +112,7 @@ impl ServerCertVerifierBuilder {
/// Default `ServerCertVerifier`, see the trait impl for more information.
#[allow(unreachable_pub)]
#[derive(Debug)]
pub struct WebPkiServerVerifier {
roots: Arc<RootCertStore>,
crls: Vec<CertRevocationList<'static>>,

View File

@ -154,6 +154,7 @@ fn client_can_override_certificate_verification_and_offer_no_signature_schemes()
}
}
#[derive(Debug)]
pub struct MockServerVerifier {
cert_rejection_error: Option<Error>,
tls12_signature_error: Option<Error>,