Respect explicit tunnel security off

This commit is contained in:
RWDai
2026-05-22 15:20:36 +08:00
parent 33633637e5
commit 08b27806a7
6 changed files with 46 additions and 24 deletions
+11 -2
View File
@@ -96,10 +96,10 @@ impl ServerTab {
Field {
label: "Tunnel Security",
key: "tunnel_security",
value: "off".into(),
value: String::new(),
kind: FieldKind::Text,
required: false,
help: "off or non_tls_required; http:// plus a key auto-enables secure tunnel",
help: "off or non_tls_required; omit to auto-enable for http:// plus a key",
},
Field {
label: "Tunnel Encryption Key",
@@ -1180,6 +1180,15 @@ mod tests {
);
}
#[test]
fn to_config_omits_blank_tunnel_security_for_auto_inference() {
let app = sample_app();
let cfg = app.to_config().expect("config should serialize");
assert_eq!(cfg.servers.len(), 1);
assert_eq!(cfg.servers[0].tunnel_security, None);
}
#[test]
fn to_config_rejects_non_tls_security_without_key() {
let mut app = sample_app();