Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions crates/factor-outbound-networking/src/tls.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use std::{collections::HashMap, ops::Deref, sync::Arc};
use std::{
collections::HashMap,
ops::Deref,
sync::{Arc, LazyLock},
};

use anyhow::{Context, ensure};

Expand Down Expand Up @@ -164,7 +168,11 @@ impl Deref for TlsClientConfig {

impl Default for TlsClientConfig {
fn default() -> Self {
Self::new(true, true, vec![], None).expect("default client config should be valid")
static ONCE: LazyLock<TlsClientConfig> = LazyLock::new(|| {
TlsClientConfig::new(true, true, vec![], None)
.expect("default client config should be valid")
});
ONCE.clone()
}
}

Expand Down
Loading