From c88d0616f6489a0b4eda732a0c92b42297be9ae1 Mon Sep 17 00:00:00 2001 From: "Lawrence, Rendall" Date: Wed, 15 Jan 2025 14:02:02 +0300 Subject: [PATCH] (minor) redis: skip empty CA cert files --- storage/redis/storage.go | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/storage/redis/storage.go b/storage/redis/storage.go index 5aba7c9..d665d55 100644 --- a/storage/redis/storage.go +++ b/storage/redis/storage.go @@ -217,20 +217,14 @@ func (cfg Config) Connect() (con Connection, err error) { if certData, err = os.ReadFile(cert); err != nil { logger.Warn(). Err(err). - Str("name", cert). - Msg("unable to read certificate file") - } else if len(certData) > 0 { - if added := certPool.AppendCertsFromPEM(certData); added { - ok = true - } else { - logger.Warn(). - Str("name", cert). - Msg("unable to append certificate to trusted pool") - } + Str("path", cert). + Msg("unable to read certificate(s) file") + } else if added := certPool.AppendCertsFromPEM(certData); added { + ok = true } else { logger.Warn(). - Str("name", cert). - Msg("empty certificate file") + Str("path", cert). + Msg("unable to append certificate(s) to trusted pool") } } if ok {