From 8c19c0a3b55cc82ca181d772ab6102646565f905 Mon Sep 17 00:00:00 2001 From: Andy Doan Date: Wed, 13 Dec 2023 16:34:01 -0600 Subject: [PATCH] main: Fix loading of client CAs This happened to work because I usually test it with the "local-ca" used by the est server *and* my factory registration reference server. However, when you need to trust many client ca's, this was totally broken. Signed-off-by: Andy Doan --- cmd/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/main.go b/cmd/main.go index f3ca33a..507d816 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -72,7 +72,9 @@ func main() { pemBytes, err := os.ReadFile(*clientCas) if err != nil { log.Fatal().Err(err).Msg("Unable to load client CAs") - caPool.AppendCertsFromPEM(pemBytes) + } + if ok := caPool.AppendCertsFromPEM(pemBytes); !ok { + log.Fatal().Msg("Unable to load client CAs") } }