summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index f4009bc..ab6b62c 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -758,6 +758,8 @@ async fn main() {
let web_config: WebserverConfig = serde_json::from_reader(std::fs::File::open(config_path).expect("file exists and is accessible")).expect("valid json for WebserverConfig");
let mut psks = PSKS.write().expect("can write lock");
*psks = web_config.psks.clone();
+ // drop write lock so we can read PSKS elsewhere WITHOUT deadlocking.
+ std::mem::drop(psks);
let config = RustlsConfig::from_pem_file(
web_config.cert_path.clone(),