Crypto provider test fixes
This commit is contained in:
@@ -70,6 +70,9 @@ impl DavClient {
|
|||||||
.redirect_auth_headers(RedirectAuthHeaders::SameHost)
|
.redirect_auth_headers(RedirectAuthHeaders::SameHost)
|
||||||
.tls_config(
|
.tls_config(
|
||||||
TlsConfig::builder()
|
TlsConfig::builder()
|
||||||
|
.unversioned_rustls_crypto_provider(std::sync::Arc::new(
|
||||||
|
rustls::crypto::aws_lc_rs::default_provider(),
|
||||||
|
))
|
||||||
.root_certs(RootCerts::PlatformVerifier)
|
.root_certs(RootCerts::PlatformVerifier)
|
||||||
.disable_verification(allow_invalid_certs)
|
.disable_verification(allow_invalid_certs)
|
||||||
.build(),
|
.build(),
|
||||||
|
|||||||
@@ -135,6 +135,9 @@ fn build_agent(allow_invalid_certs: bool) -> Agent {
|
|||||||
.http_status_as_error(false)
|
.http_status_as_error(false)
|
||||||
.tls_config(
|
.tls_config(
|
||||||
TlsConfig::builder()
|
TlsConfig::builder()
|
||||||
|
.unversioned_rustls_crypto_provider(std::sync::Arc::new(
|
||||||
|
rustls::crypto::aws_lc_rs::default_provider(),
|
||||||
|
))
|
||||||
.root_certs(RootCerts::PlatformVerifier)
|
.root_certs(RootCerts::PlatformVerifier)
|
||||||
.disable_verification(allow_invalid_certs)
|
.disable_verification(allow_invalid_certs)
|
||||||
.build(),
|
.build(),
|
||||||
|
|||||||
@@ -61,6 +61,9 @@ impl EwsClient {
|
|||||||
.redirect_auth_headers(RedirectAuthHeaders::SameHost)
|
.redirect_auth_headers(RedirectAuthHeaders::SameHost)
|
||||||
.tls_config(
|
.tls_config(
|
||||||
TlsConfig::builder()
|
TlsConfig::builder()
|
||||||
|
.unversioned_rustls_crypto_provider(std::sync::Arc::new(
|
||||||
|
rustls::crypto::aws_lc_rs::default_provider(),
|
||||||
|
))
|
||||||
.root_certs(RootCerts::PlatformVerifier)
|
.root_certs(RootCerts::PlatformVerifier)
|
||||||
.disable_verification(allow_invalid_certs)
|
.disable_verification(allow_invalid_certs)
|
||||||
.build(),
|
.build(),
|
||||||
|
|||||||
@@ -112,6 +112,9 @@ fn build_agent(allow_invalid_certs: bool) -> ureq::Agent {
|
|||||||
.http_status_as_error(false)
|
.http_status_as_error(false)
|
||||||
.tls_config(
|
.tls_config(
|
||||||
TlsConfig::builder()
|
TlsConfig::builder()
|
||||||
|
.unversioned_rustls_crypto_provider(std::sync::Arc::new(
|
||||||
|
rustls::crypto::aws_lc_rs::default_provider(),
|
||||||
|
))
|
||||||
.root_certs(RootCerts::PlatformVerifier)
|
.root_certs(RootCerts::PlatformVerifier)
|
||||||
.disable_verification(allow_invalid_certs)
|
.disable_verification(allow_invalid_certs)
|
||||||
.build(),
|
.build(),
|
||||||
|
|||||||
@@ -91,6 +91,9 @@ impl GraphClient {
|
|||||||
.redirect_auth_headers(RedirectAuthHeaders::SameHost)
|
.redirect_auth_headers(RedirectAuthHeaders::SameHost)
|
||||||
.tls_config(
|
.tls_config(
|
||||||
TlsConfig::builder()
|
TlsConfig::builder()
|
||||||
|
.unversioned_rustls_crypto_provider(std::sync::Arc::new(
|
||||||
|
rustls::crypto::aws_lc_rs::default_provider(),
|
||||||
|
))
|
||||||
.root_certs(RootCerts::PlatformVerifier)
|
.root_certs(RootCerts::PlatformVerifier)
|
||||||
.disable_verification(allow_invalid_certs)
|
.disable_verification(allow_invalid_certs)
|
||||||
.build(),
|
.build(),
|
||||||
|
|||||||
@@ -86,6 +86,9 @@ fn build_agent(allow_invalid_certs: bool) -> ureq::Agent {
|
|||||||
.http_status_as_error(false)
|
.http_status_as_error(false)
|
||||||
.tls_config(
|
.tls_config(
|
||||||
TlsConfig::builder()
|
TlsConfig::builder()
|
||||||
|
.unversioned_rustls_crypto_provider(std::sync::Arc::new(
|
||||||
|
rustls::crypto::aws_lc_rs::default_provider(),
|
||||||
|
))
|
||||||
.root_certs(RootCerts::PlatformVerifier)
|
.root_certs(RootCerts::PlatformVerifier)
|
||||||
.disable_verification(allow_invalid_certs)
|
.disable_verification(allow_invalid_certs)
|
||||||
.build(),
|
.build(),
|
||||||
|
|||||||
@@ -102,6 +102,9 @@ impl HttpClient {
|
|||||||
.redirect_auth_headers(RedirectAuthHeaders::SameHost)
|
.redirect_auth_headers(RedirectAuthHeaders::SameHost)
|
||||||
.tls_config(
|
.tls_config(
|
||||||
TlsConfig::builder()
|
TlsConfig::builder()
|
||||||
|
.unversioned_rustls_crypto_provider(std::sync::Arc::new(
|
||||||
|
rustls::crypto::aws_lc_rs::default_provider(),
|
||||||
|
))
|
||||||
.root_certs(RootCerts::PlatformVerifier)
|
.root_certs(RootCerts::PlatformVerifier)
|
||||||
.disable_verification(allow_invalid_certs)
|
.disable_verification(allow_invalid_certs)
|
||||||
.build(),
|
.build(),
|
||||||
|
|||||||
-10
@@ -19,13 +19,3 @@ pub mod managesieve;
|
|||||||
pub mod secret;
|
pub mod secret;
|
||||||
pub mod sync;
|
pub mod sync;
|
||||||
pub mod types;
|
pub mod types;
|
||||||
|
|
||||||
use std::sync::Once;
|
|
||||||
|
|
||||||
static CRYPTO_INIT: Once = Once::new();
|
|
||||||
|
|
||||||
pub fn install_default_crypto_provider() {
|
|
||||||
CRYPTO_INIT.call_once(|| {
|
|
||||||
let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ use vandelay::inspect;
|
|||||||
use vandelay::sync::{self, Summary};
|
use vandelay::sync::{self, Summary};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
vandelay::install_default_crypto_provider();
|
|
||||||
let code = run();
|
let code = run();
|
||||||
std::process::exit(code);
|
std::process::exit(code);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ pub struct DavSeed {
|
|||||||
|
|
||||||
impl DavSeed {
|
impl DavSeed {
|
||||||
pub fn new(base: impl Into<String>, user: &str, password: &str) -> Self {
|
pub fn new(base: impl Into<String>, user: &str, password: &str) -> Self {
|
||||||
|
super::install_crypto_provider();
|
||||||
let agent = ureq::Agent::config_builder()
|
let agent = ureq::Agent::config_builder()
|
||||||
.http_status_as_error(false)
|
.http_status_as_error(false)
|
||||||
.allow_non_standard_methods(true)
|
.allow_non_standard_methods(true)
|
||||||
|
|||||||
@@ -22,6 +22,16 @@ pub mod webdav;
|
|||||||
|
|
||||||
pub use error::{ContainerError, ContainerResult};
|
pub use error::{ContainerError, ContainerResult};
|
||||||
|
|
||||||
|
use std::sync::Once;
|
||||||
|
|
||||||
|
static CRYPTO_INIT: Once = Once::new();
|
||||||
|
|
||||||
|
pub fn install_crypto_provider() {
|
||||||
|
CRYPTO_INIT.call_once(|| {
|
||||||
|
let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct Endpoint {
|
pub struct Endpoint {
|
||||||
pub host: String,
|
pub host: String,
|
||||||
|
|||||||
Reference in New Issue
Block a user