mirror of https://github.com/ctz/rustls
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:
parent
ff86ccf140
commit
cc0666e795
|
@ -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 {
|
||||
|
|
|
@ -241,6 +241,7 @@ impl server::danger::ClientCertVerifier for DummyClientAuth {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct DummyServerAuth {}
|
||||
|
||||
impl client::danger::ServerCertVerifier for DummyServerAuth {
|
||||
|
|
|
@ -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.
|
||||
///
|
||||
|
|
|
@ -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>>,
|
||||
|
|
|
@ -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>,
|
||||
|
|
Loading…
Reference in New Issue