diff --git a/examples/main.rs b/examples/main.rs index b1172ca..77faa9e 100644 --- a/examples/main.rs +++ b/examples/main.rs @@ -1,3 +1,4 @@ +use async_trait::async_trait; use tokio_gemini::{ certs::{ dane, file_sscv::KnownHostsFile, fingerprint::CertFingerprint, SelfsignedCertVerifier, @@ -120,10 +121,11 @@ struct CertVerifier { dns: Option, } +#[async_trait] impl SelfsignedCertVerifier for CertVerifier { - async fn verify<'c>( + async fn verify( &self, - cert: &'c tokio_gemini::certs::CertificateDer<'c>, + cert: &tokio_gemini::certs::CertificateDer<'_>, host: &str, port: u16, ) -> Result { diff --git a/examples/simple.rs b/examples/simple.rs index dab66cd..91522f4 100644 --- a/examples/simple.rs +++ b/examples/simple.rs @@ -1,3 +1,4 @@ +use async_trait::async_trait; use tokio_gemini::{ certs::{fingerprint::CertFingerprint, SelfsignedCertVerifier}, Client, LibError, @@ -32,10 +33,11 @@ async fn main() -> Result<(), LibError> { struct CertVerifier; +#[async_trait] impl SelfsignedCertVerifier for CertVerifier { - async fn verify<'c>( + async fn verify( &self, - cert: &'c tokio_gemini::certs::CertificateDer<'c>, + cert: &tokio_gemini::certs::CertificateDer<'_>, host: &str, port: u16, ) -> Result { diff --git a/src/certs/mod.rs b/src/certs/mod.rs index bb728ed..e4f30b7 100644 --- a/src/certs/mod.rs +++ b/src/certs/mod.rs @@ -17,9 +17,9 @@ pub use tokio_rustls::rustls::pki_types::{CertificateDer, ServerName, UnixTime}; /// It is recommended to use helpers from file_sscv. #[async_trait] pub trait SelfsignedCertVerifier: Send + Sync { - async fn verify<'c>( + async fn verify( &self, - cert: &'c CertificateDer<'c>, + cert: &CertificateDer<'_>, host: &str, port: u16, // now: UnixTime,