aboutsummaryrefslogtreecommitdiffstats
path: root/crates/daemon/src/aclient
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-20 18:23:39 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2026-07-20 18:24:17 +0200
commit0bcb8e7bd8aefb089ad88f5ebfd7364ae81cdf06 (patch)
tree83e098b147f25670ff15f7bcd1ac72dc1115b3b6 /crates/daemon/src/aclient
parentchore: Remove some warnings (cargo fix) (diff)
downloadatuin-0bcb8e7bd8aefb089ad88f5ebfd7364ae81cdf06.zip
chore(server): Remove warnings
Diffstat (limited to 'crates/daemon/src/aclient')
-rw-r--r--crates/daemon/src/aclient/api_client.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/crates/daemon/src/aclient/api_client.rs b/crates/daemon/src/aclient/api_client.rs
index 666e6dce..c0688cf9 100644
--- a/crates/daemon/src/aclient/api_client.rs
+++ b/crates/daemon/src/aclient/api_client.rs
@@ -10,7 +10,6 @@ use turtle_common::{api::ErrorResponse, record::RecordStatus};
use turtle_common::{
api::{ATUIN_CARGO_VERSION, ATUIN_HEADER_VERSION, ATUIN_VERSION},
record::{EncryptedData, HostId, Record, RecordIdx},
- tls::ensure_crypto_provider,
};
use semver::Version;
@@ -101,6 +100,22 @@ async fn handle_resp_error(resp: Response) -> Result<Response> {
Ok(resp)
}
+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.
+fn ensure_crypto_provider() {
+ INIT.call_once(|| {
+ rustls::crypto::ring::default_provider()
+ .install_default()
+ .expect("Failed to install rustls crypto provider");
+ });
+}
+
impl<'a> Client<'a> {
pub(crate) fn new(
sync_addr: &'a str,