This commit is contained in:
parent
1b796d0ce7
commit
c15a8da32c
5 changed files with 26 additions and 5 deletions
|
|
@ -27,6 +27,8 @@ serde = { version = "1", optional = true, features = ["derive"] }
|
|||
rcgen = { version = "0.14", optional = true }
|
||||
time = { version = "0.3", optional = true }
|
||||
tokio = { version = "1", features = ["macros", "rt"], optional = true }
|
||||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
rustls = "0.23.41"
|
||||
|
||||
[features]
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ pub mod auth;
|
|||
pub mod error;
|
||||
pub mod keypair;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use std::sync::Once;
|
||||
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
static CRYPTO_INIT: Once = Once::new();
|
||||
|
||||
#[cfg(feature = "sha2")]
|
||||
|
|
@ -70,6 +72,7 @@ pub use enc::EncryptionType;
|
|||
///
|
||||
/// Rustls only accepts one process-wide default provider. Calling this helper
|
||||
/// from every TLS entry point makes that initialization idempotent.
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
pub fn ensure_crypto_provider() {
|
||||
CRYPTO_INIT.call_once(|| {
|
||||
let _ = rustls::crypto::aws_lc_rs::default_provider().install_default();
|
||||
|
|
|
|||
Loading…
Reference in a new issue