Skip to content

Commit

Permalink
Report issuers tried on cert_failed (fix #204)
Browse files Browse the repository at this point in the history
Instead of assuming issuerUsed is non-nil in the error case
  • Loading branch information
mholt committed Sep 1, 2022
1 parent ab3db75 commit 2e22c6f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions config.go
Expand Up @@ -539,7 +539,10 @@ func (cfg *Config) obtainCert(ctx context.Context, name string, interactive bool
// try to obtain from each issuer until we succeed
var issuedCert *IssuedCertificate
var issuerUsed Issuer
var issuerKeys []string
for i, issuer := range issuers {
issuerKeys = append(issuerKeys, issuer.IssuerKey())

if log != nil {
log.Debug(fmt.Sprintf("trying issuer %d/%d", i+1, len(cfg.Issuers)),
zap.String("issuer", issuer.IssuerKey()))
Expand Down Expand Up @@ -576,7 +579,7 @@ func (cfg *Config) obtainCert(ctx context.Context, name string, interactive bool
cfg.emit(ctx, "cert_failed", map[string]any{
"renewal": false,
"identifier": name,
"issuer": issuerUsed.IssuerKey(),
"issuers": issuerKeys,
"error": err,
})

Expand All @@ -603,7 +606,7 @@ func (cfg *Config) obtainCert(ctx context.Context, name string, interactive bool
cfg.emit(ctx, "cert_obtained", map[string]any{
"renewal": false,
"identifier": name,
"issuer": issuerUsed.IssuerKey(),
"issuers": issuerUsed.IssuerKey(),
"storage_key": certRes.NamesKey(),
})

Expand Down

0 comments on commit 2e22c6f

Please sign in to comment.