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 <andy@foundries.io>
This commit is contained in:
Andy Doan
2023-12-13 16:34:01 -06:00
parent 751724a936
commit 8c19c0a3b5

View File

@@ -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")
}
}