From 1395bb04fff95dffdd60670ea060223da9602eda Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Tue, 6 Aug 2024 18:36:40 +0400 Subject: [PATCH] fix: CryptoProvider::get_default returned None --- src/certs/insecure.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/certs/insecure.rs b/src/certs/insecure.rs index f7d6c23..ae4a48d 100644 --- a/src/certs/insecure.rs +++ b/src/certs/insecure.rs @@ -9,7 +9,11 @@ pub struct AllowAllCertVerifier(std::sync::Arc); impl AllowAllCertVerifier { pub fn yes_i_know_what_i_am_doing() -> Self { - AllowAllCertVerifier(CryptoProvider::get_default().unwrap().clone()) + AllowAllCertVerifier( + CryptoProvider::get_default() + .map(|c| c.clone()) + .unwrap_or_else(|| std::sync::Arc::new(rustls::crypto::ring::default_provider())), + ) } }