ROCSP: Catch correct live-signing NotFound error (#6467)

Previously, the live-signing routine was lookking for
`rocsp.ErrRedisNotFound` errors in order to increment the
`certificate_not_found` metrics. But this was a bug, copy-pasted from
code higher in the file that does a similar check. The live-signing code
actually returns `responder.ErrNotFound`. Check for that error instead,
to properly increment our metrics.
This commit is contained in:
Aaron Gable 2022-10-27 16:38:20 -07:00 committed by GitHub
parent 682997f114
commit f246ca10ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -154,7 +154,7 @@ const (
func (src *redisSource) signAndSave(ctx context.Context, req *ocsp.Request, cause signAndSaveCause) (*responder.Response, error) {
resp, err := src.signer.Response(ctx, req)
if err != nil {
if errors.Is(err, rocsp.ErrRedisNotFound) {
if errors.Is(err, responder.ErrNotFound) {
src.signAndSaveCounter.WithLabelValues(string(cause), "certificate_not_found").Inc()
return nil, responder.ErrNotFound
}