blob: e8c840e07a10a68705b6e15cf93ae7c18b05bb4a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
use std::sync::Once;
static INIT: Once = Once::new();
/// Ensure the rustls crypto provider (ring) is installed.
///
/// Must be called before creating any reqwest clients. Safe to call
/// multiple times — only the first call installs the provider.
pub fn ensure_crypto_provider() {
INIT.call_once(|| {
rustls::crypto::ring::default_provider()
.install_default()
.expect("Failed to install rustls crypto provider");
});
}
|