From 7a6f3f5ea1b2f7f60a9a0d6c603e2a1c09bbd99d Mon Sep 17 00:00:00 2001 From: Carl Tashian Date: Wed, 8 Feb 2023 11:39:44 -0800 Subject: [PATCH] Clarify error when root certificate is not found --- ca/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ca/client.go b/ca/client.go index 7321f82f..b27a98c4 100644 --- a/ca/client.go +++ b/ca/client.go @@ -671,6 +671,10 @@ retry: if err != nil { return nil, clientError(err) } + if resp.StatusCode == 404 { + defer resp.Body.Close() + return nil, errs.BadRequest("a root certificate with that fingerprint was not found") + } if resp.StatusCode >= 400 { if !retried && c.retryOnError(resp) { //nolint:contextcheck // deeply nested context; retry using the same context retried = true