fix: finally, async-trait works
This commit is contained in:
parent
e042a139bf
commit
49c46aeaf5
3 changed files with 10 additions and 6 deletions
|
@ -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<DnsClient>,
|
||||
}
|
||||
|
||||
#[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<bool, tokio_gemini::LibError> {
|
||||
|
|
|
@ -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<bool, tokio_gemini::LibError> {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue