Unverified Commit e868bfa5 authored by Raymond Douglas's avatar Raymond Douglas
Browse files

wstunnel: exclude TLS arguments when `enableHTTPS is` false

parent d33b5534
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -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
  ];