From e868bfa5b13f5e0b3f092edc6f54b65039ccf301 Mon Sep 17 00:00:00 2001 From: Raymond Douglas Date: Mon, 16 Sep 2024 14:27:42 -0700 Subject: [PATCH] wstunnel: exclude TLS arguments when `enableHTTPS is` false --- nixos/modules/services/networking/wstunnel.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/networking/wstunnel.nix b/nixos/modules/services/networking/wstunnel.nix index c05e00809357..bf56858a190f 100644 --- a/nixos/modules/services/networking/wstunnel.nix +++ b/nixos/modules/services/networking/wstunnel.nix @@ -318,10 +318,21 @@ let lib.cli.toGNUCommandLineShell { } ( lib.recursiveUpdate { restrict-to = map hostPortToString restrictTo; - tls-certificate = - if useACMEHost != null then "${certConfig.directory}/fullchain.pem" else "${tlsCertificate}"; - tls-private-key = if useACMEHost != null then "${certConfig.directory}/key.pem" else "${tlsKey}"; websocket-ping-frequency-sec = websocketPingInterval; + tls-certificate = + if !enableHTTPS then + null + else if useACMEHost != null then + "${certConfig.directory}/fullchain.pem" + else + "${tlsCertificate}"; + tls-private-key = + if !enableHTTPS then + null + else if useACMEHost != null then + "${certConfig.directory}/key.pem" + else + "${tlsKey}"; } extraArgs ) } \ @@ -475,6 +486,7 @@ in meta.maintainers = with lib.maintainers; [ alyaeanyx + raylas rvdp neverbehave ];