Managed to update rustls to version 0.21

This commit is contained in:
2024-01-17 19:52:28 +01:00
parent 5609708848
commit e534deefae
5 changed files with 41 additions and 48 deletions

View File

@ -1,9 +1,8 @@
use std::sync::Arc;
use std::time::SystemTime;
use rustls::internal::msgs::enums::AlertDescription;
use rustls::server::{AllowAnyAuthenticatedClient, ClientCertVerified, ClientCertVerifier};
use rustls::{Certificate, DistinguishedNames, Error, RootCertStore};
use rustls::{AlertDescription, Certificate, DistinguishedName, Error, RootCertStore};
use x509_parser::prelude::{CertificateRevocationList, FromDer, X509Certificate};
use crate::base::cert_utils::parse_pem_certificates;
@ -61,7 +60,7 @@ impl CustomCertClientVerifier {
};
Ok(Self {
upstream_cert_verifier: Box::new(AllowAnyAuthenticatedClient::new(store)),
upstream_cert_verifier: Box::new(Arc::new(AllowAnyAuthenticatedClient::new(store))),
crl,
})
}
@ -72,12 +71,12 @@ impl ClientCertVerifier for CustomCertClientVerifier {
true
}
fn client_auth_mandatory(&self) -> Option<bool> {
Some(true)
fn client_auth_mandatory(&self) -> bool {
true
}
fn client_auth_root_subjects(&self) -> Option<DistinguishedNames> {
Some(vec![])
fn client_auth_root_subjects(&self) -> &[DistinguishedName] {
&[]
}
fn verify_client_cert(