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
+27
View File
@@ -448,6 +448,33 @@ async fn rotated_keys_are_accepted_through_previous_listing() {
assert!(revoked.is_empty(), "revoked key was still accepted");
}
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn plain_http_transport_is_refused_off_loopback() {
let root = tempfile::tempdir().unwrap();
let mut config = config_for(&root.path().join("alice"), "alice", "http://10.0.0.1:1");
let refused = Node::start(config.clone()).await;
assert!(
refused.is_err(),
"plain http to a non-loopback relay must be refused"
);
config.node.allow_insecure = true;
let node = Node::start(config).await.unwrap();
let outcome = frxd::node::control_query(
&format!("http://{}", node.addr),
"rust",
Some(5),
Some(100),
false,
)
.await
.unwrap();
assert_eq!(
outcome.pointer("/local/total").and_then(Value::as_u64),
Some(0)
);
}
#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
async fn stale_envelopes_are_rejected() {
let relay_url = spawn_relay().await;