From 03c9ad5f3c52a98d65f830cfd51d401457587c2c Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Tue, 23 Jul 2024 11:40:40 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20v=C3=A9rifier=20existence=20de=20certfil?= =?UTF-8?q?e=20et=20keyfile=20pour=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Au lieu de print leur valeur à l'écran --- cmd.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd.go b/cmd.go index 8fbd66b..3fe7a06 100644 --- a/cmd.go +++ b/cmd.go @@ -129,8 +129,13 @@ var apiCmd = &cobra.Command{ ), ) case true: - //TODO - log.Printf("dbg: certfile='%s' keyfile='%s'", cfg.Server.API.TLS.Certfile, cfg.Server.API.TLS.Keyfile) + if cfg.Server.API.TLS.Certfile == "" { + log.Fatal("TLS enabled for API but no certificate file provided") + } + + if cfg.Server.API.TLS.Keyfile == "" { + log.Fatal("TLS enabled for UI but no private key file provided") + } e.Logger.Fatal( e.StartTLS( -- 2.45.2