From f15a276da1a7f94a7349a1c214cd2cdf3513a1c8 Mon Sep 17 00:00:00 2001 From: Enrique Lacal Date: Mon, 17 Jun 2024 10:57:31 +0100 Subject: [PATCH 1/2] Add logs when loading TLS config Signed-off-by: Enrique Lacal --- pkg/fftls/fftls.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/fftls/fftls.go b/pkg/fftls/fftls.go index 61280d6..8998fbd 100644 --- a/pkg/fftls/fftls.go +++ b/pkg/fftls/fftls.go @@ -63,6 +63,7 @@ func NewTLSConfig(ctx context.Context, config *Config, tlsType TLSType) (*tls.Co // Support custom CA file var rootCAs *x509.CertPool if config.CAFile != "" { + log.L(ctx).Debugf("Loading CA file at %s", config.CAFile) rootCAs = x509.NewCertPool() var caBytes []byte caBytes, err = os.ReadFile(config.CAFile) @@ -84,6 +85,7 @@ func NewTLSConfig(ctx context.Context, config *Config, tlsType TLSType) (*tls.Co // For mTLS we need both the cert and key if config.CertFile != "" && config.KeyFile != "" { + log.L(ctx).Debugf("Loading Cert file at %s and Key file at %s", config.CertFile, config.KeyFile) // Read the key pair to create certificate cert, err := tls.LoadX509KeyPair(config.CertFile, config.KeyFile) if err != nil { From 71212c5dcf23f3df840e983c22bbdade88b9514a Mon Sep 17 00:00:00 2001 From: Enrique Lacal Date: Mon, 30 Sep 2024 17:52:17 +0200 Subject: [PATCH 2/2] fix formatting Signed-off-by: Enrique Lacal --- pkg/fftls/fftls.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/fftls/fftls.go b/pkg/fftls/fftls.go index 0322c8a..a732b34 100644 --- a/pkg/fftls/fftls.go +++ b/pkg/fftls/fftls.go @@ -64,7 +64,7 @@ func NewTLSConfig(ctx context.Context, config *Config, tlsType TLSType) (*tls.Co var rootCAs *x509.CertPool switch { case config.CAFile != "": - log.L(ctx).Debugf("Loading CA file at %s", config.CAFile) + log.L(ctx).Debugf("Loading CA file at %s", config.CAFile) rootCAs = x509.NewCertPool() var caBytes []byte caBytes, err = os.ReadFile(config.CAFile)