diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-05-01 16:42:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-01 16:42:05 -0400 |
commit | 913176313b6869eeb29b8d48e0c8d80227fa6544 (patch) | |
tree | cc0128b36ea9b22207a3dd41a401ae4ecd131e74 /ext/tls | |
parent | ecc70eb58fd5531f3b93402cf781e93ef2bb4d64 (diff) |
perf: lazily create RootCertStore (#18938)
Diffstat (limited to 'ext/tls')
-rw-r--r-- | ext/tls/lib.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/tls/lib.rs b/ext/tls/lib.rs index 123d35acf..3034e2ae9 100644 --- a/ext/tls/lib.rs +++ b/ext/tls/lib.rs @@ -34,6 +34,14 @@ use std::io::Cursor; use std::sync::Arc; use std::time::SystemTime; +/// Lazily resolves the root cert store. +/// +/// This was done because the root cert store is not needed in all cases +/// and takes a bit of time to initialize. +pub trait RootCertStoreProvider: Send + Sync { + fn get_or_try_init(&self) -> Result<&RootCertStore, AnyError>; +} + // This extension has no runtime apis, it only exports some shared native functions. deno_core::extension!(deno_tls); |