Jelajahi Sumber

Clarify error when root certificate is not found

Carl Tashian 3 tahun lalu
induk
melakukan
7a6f3f5ea1
1 mengubah file dengan 4 tambahan dan 0 penghapusan
  1. 4 0
      ca/client.go

+ 4 - 0
ca/client.go

@@ -671,6 +671,10 @@ retry:
 	if err != nil {
 	if err != nil {
 		return nil, clientError(err)
 		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 resp.StatusCode >= 400 {
 		if !retried && c.retryOnError(resp) { //nolint:contextcheck // deeply nested context; retry using the same context
 		if !retried && c.retryOnError(resp) { //nolint:contextcheck // deeply nested context; retry using the same context
 			retried = true
 			retried = true