diff --git a/docs/sources/articles/certificates.md b/docs/sources/articles/certificates.md index 90d3f1b356..e031676402 100644 --- a/docs/sources/articles/certificates.md +++ b/docs/sources/articles/certificates.md @@ -31,7 +31,7 @@ repository. > **Note:** > If there are multiple certificates, each will be tried in alphabetical -> order. If there is an authentication error (e.g., 403, 5xx, etc.), Docker +> order. If there is an authentication error (e.g., 403, 404, 5xx, etc.), Docker > will continue to try with the next certificate. Our example is set up like this: diff --git a/registry/registry.go b/registry/registry.go index 0c648a94b2..d1315ed4b6 100644 --- a/registry/registry.go +++ b/registry/registry.go @@ -147,7 +147,10 @@ func doRequest(req *http.Request, jar http.CookieJar, timeout TimeoutType) (*htt client := newClient(jar, pool, cert, timeout) res, err := client.Do(req) // If this is the last cert, otherwise, continue to next cert if 403 or 5xx - if i == len(certs)-1 || err == nil && res.StatusCode != 403 && res.StatusCode < 500 { + if i == len(certs)-1 || err == nil && + res.StatusCode != 403 && + res.StatusCode != 404 && + res.StatusCode < 500 { return res, client, err } }