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

cert-checker: only log database errors #7077

Merged
merged 2 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 4 additions & 3 deletions cmd/cert-checker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,14 @@ func (c *certChecker) checkCert(ctx context.Context, cert core.Certificate, igno
if features.Enabled(features.CertCheckerRequiresCorrespondence) {
precertDER, err := c.getPrecert(ctx, cert.Serial)
if err != nil {
problems = append(problems,
fmt.Sprintf("fetching linting precertificate for %s: %s", cert.Serial, err))
// Log and continue, since we want the problems slice to only contains
// problems with the cert itself.
c.logger.Errf("fetching linting precertificate for %s: %s", cert.Serial, err)
} else {
err = precert.Correspond(precertDER, cert.DER)
if err != nil {
problems = append(problems,
fmt.Sprintf("checking correspondence for %s: %s", cert.Serial, err))
fmt.Sprintf("Certificate does not correspond to precert for %s: %s", cert.Serial, err))
aarongable marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/cert-checker/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ func TestPrecertCorrespond(t *testing.T) {
}
// Ensure that at least one of the problems was related to checking correspondence
for _, p := range problems {
if strings.Contains(p, "checking correspondence for") {
if strings.Contains(p, "does not correspond to precert") {
return
}
}
Expand Down