Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logs when loading TLS config #144

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/fftls/fftls.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +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)
rootCAs = x509.NewCertPool()
var caBytes []byte
caBytes, err = os.ReadFile(config.CAFile)
Expand Down Expand Up @@ -91,6 +92,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 {
Expand Down
Loading