Skip to content

Commit

Permalink
Enhance logs
Browse files Browse the repository at this point in the history
Add remote IP and User-Agent (for HTTP challenge) when error getting
challenge info
  • Loading branch information
mholt committed Jan 5, 2023
1 parent 7d6aa77 commit 0c6c025
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.go
Expand Up @@ -335,6 +335,7 @@ func (cfg *Config) manageAll(ctx context.Context, domainNames []string, async bo
continue
}

// TODO: consider doing this in a goroutine if async, to utilize multiple cores while loading certs
// otherwise, begin management immediately
err := cfg.manageOne(ctx, domainName, async)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions handshake.go
Expand Up @@ -60,6 +60,7 @@ func (cfg *Config) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certif
challengeCert, distributed, err := cfg.getTLSALPNChallengeCert(clientHello)
if err != nil {
cfg.Logger.Error("tls-alpn challenge",
zap.String("remote_addr", clientHello.Conn.RemoteAddr().String()),
zap.String("server_name", clientHello.ServerName),
zap.Error(err))
return nil, err
Expand Down
2 changes: 2 additions & 0 deletions httphandler.go
Expand Up @@ -75,6 +75,8 @@ func (am *ACMEIssuer) distributedHTTPChallengeSolver(w http.ResponseWriter, r *h
if err != nil {
am.Logger.Error("looking up info for HTTP challenge",
zap.String("host", host),
zap.String("remote_addr", r.RemoteAddr),
zap.String("user_agent", r.Header.Get("User-Agent")),
zap.Error(err))
return false
}
Expand Down

0 comments on commit 0c6c025

Please sign in to comment.