/// Ensures the certificate is valid for the services we terminate for TLS. This assumes that
/// server cert validation does the same or more validation than client cert validation.
Ensures the certificate is valid for the services we terminate for TLS. This assumes that
server cert validation does the same or more validation than client cert validation.
Ensures the certificate is valid for the services we terminate for TLS . This assumes that server cert validation does the same or more validation than client cert validation .
fn validate(&self, certs: &[rustls::Certificate]) -> Result<()> {
        let name = rustls::ServerName::try_from(self.name.as_str())
            .expect("server name must be a valid DNS name");
        static NO_OCSP: &[u8] = &[];
        let end_entity = &certs[0];
        let intermediates = &certs[1..];
        let no_scts = &mut std::iter::empty();
        let now = std::time::SystemTime::now();
        self.server_cert_verifier.verify_server_cert(
            end_entity,
            intermediates,
            &name,
            no_scts,
            NO_OCSP,
            now,
        )?;
        debug!("Certified");
        Ok(())
    }
fn validate ( & self , certs : & [ rustls :: Certificate ] ) -> Result < ( ) > { let name = rustls :: ServerName :: try_from ( self . name . as_str ( ) ) . expect ( " " ) ; static NO_OCSP : & [ u8 ] = & [ ] ; let end_entity = & certs [ 0 ] ; let intermediates = & certs [ 1 .. ] ; let no_scts = & mut std :: iter :: empty ( ) ; let now = std :: time :: SystemTime :: now ( ) ; self . server_cert_verifier . verify_server_cert ( end_entity , intermediates , & name , no_scts , NO_OCSP , now , ) ? ; debug ! ( " " ) ; Ok ( ( ) ) }
Ensures the certificate is valid for the services we terminate for TLS.
Ensures the certificate is valid for the services we terminate for TLS .
&self
certs
&[rustls::Certificate]