aboutsummaryrefslogtreecommitdiffstats
path: root/crates/atuin-common/src
diff options
context:
space:
mode:
authorEllie Huxtable <ellie@atuin.sh>2026-01-27 16:20:25 -0800
committerGitHub <noreply@github.com>2026-01-27 16:20:25 -0800
commitf294c5bca990f684b59f217dd468a41b7ac83d0e (patch)
tree4a2db9fd5c8d109124876c0eba9ba91e74618bac /crates/atuin-common/src
parentfix: custom data dir test on windows (#3109) (diff)
downloadatuin-f294c5bca990f684b59f217dd468a41b7ac83d0e.zip
chore(deps): audit ssl deps (#3110)
<!-- Thank you for making a PR! Bug fixes are always welcome, but if you're adding a new feature or changing an existing one, we'd really appreciate if you open an issue, post on the forum, or drop in on Discord --> ## Checks - [ ] I am happy for maintainers to push small adjustments to this PR, to speed up the review cycle - [ ] I have checked that there are no existing pull requests for the same thing
Diffstat (limited to 'crates/atuin-common/src')
-rw-r--r--crates/atuin-common/src/lib.rs1
-rw-r--r--crates/atuin-common/src/tls.rs15
2 files changed, 16 insertions, 0 deletions
diff --git a/crates/atuin-common/src/lib.rs b/crates/atuin-common/src/lib.rs
index 75bfc3e9..91164a82 100644
--- a/crates/atuin-common/src/lib.rs
+++ b/crates/atuin-common/src/lib.rs
@@ -56,4 +56,5 @@ macro_rules! new_uuid {
pub mod api;
pub mod record;
pub mod shell;
+pub mod tls;
pub mod utils;
diff --git a/crates/atuin-common/src/tls.rs b/crates/atuin-common/src/tls.rs
new file mode 100644
index 00000000..e8c840e0
--- /dev/null
+++ b/crates/atuin-common/src/tls.rs
@@ -0,0 +1,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");
+ });
+}