TLS guardrails (insecure http refusal, custom CAs) and deployment guide

This commit is contained in:
George Coles
2026-09-15 07:10:32 -04:00
parent ec98275613
commit 67112c2af3
12 changed files with 349 additions and 8 deletions
+13 -4
View File
@@ -119,10 +119,19 @@ impl Node {
let members_mtime = fs::metadata(&members_path)
.and_then(|metadata| metadata.modified())
.ok();
let client = reqwest::Client::builder()
.timeout(Duration::from_secs(15))
.build()
.context("building http client")?;
if !config.node.allow_insecure {
let insecure = config.insecure_endpoints();
if !insecure.is_empty() {
return Err(anyhow!(
"refusing plain http endpoints (use https, configure ca_cert, or set allow_insecure for private networks): {}",
insecure.join(", ")
));
}
}
let client = crate::net::build_client(
config.node.ca_cert.as_deref().map(std::path::Path::new),
Duration::from_secs(15),
)?;
let registry = match (
config.node.registry.as_deref(),
config.node.ma_key.as_deref(),