Blame SOURCES/0001-On-Red-Hat-Registry-Servers-we-return-404-on-certifi.patch

bf7bdc
diff -up docker-2a2f26c1979cdaed884c765ea3dd203543e7e284/docs/sources/articles/certificates.md.404 docker-2a2f26c1979cdaed884c765ea3dd203543e7e284/docs/sources/articles/certificates.md
bf7bdc
--- docker-2a2f26c1979cdaed884c765ea3dd203543e7e284/docs/sources/articles/certificates.md.404	2014-09-22 10:40:10.000000000 -0400
bf7bdc
+++ docker-2a2f26c1979cdaed884c765ea3dd203543e7e284/docs/sources/articles/certificates.md	2014-10-20 13:23:56.827130505 -0400
bf7bdc
@@ -31,7 +31,7 @@ repository.
bf7bdc
 
bf7bdc
 > **Note:**
bf7bdc
 > If there are multiple certificates, each will be tried in alphabetical
bf7bdc
-> order. If there is an authentication error (e.g., 403, 5xx, etc.), Docker
bf7bdc
+> order. If there is an authentication error (e.g., 403, 404, 5xx, etc.), Docker
bf7bdc
 > will continue to try with the next certificate.
bf7bdc
 
bf7bdc
 Our example is set up like this:
bf7bdc
diff -up docker-2a2f26c1979cdaed884c765ea3dd203543e7e284/registry/registry.go.404 docker-2a2f26c1979cdaed884c765ea3dd203543e7e284/registry/registry.go
bf7bdc
--- docker-2a2f26c1979cdaed884c765ea3dd203543e7e284/registry/registry.go.404	2014-10-20 13:23:56.828130500 -0400
bf7bdc
+++ docker-2a2f26c1979cdaed884c765ea3dd203543e7e284/registry/registry.go	2014-10-20 13:26:00.736574647 -0400
bf7bdc
@@ -168,14 +168,11 @@ func doRequest(req *http.Request, jar ht
bf7bdc
 		for i, cert := range certs {
bf7bdc
 			client := newClient(jar, pool, cert, timeout)
bf7bdc
 			res, err := client.Do(req)
bf7bdc
-			if i == len(certs)-1 {
bf7bdc
-				// If this is the last cert, always return the result
bf7bdc
+			if i == len(certs)-1 || err == nil &&
bf7bdc
+				res.StatusCode != 403 &&
bf7bdc
+				res.StatusCode != 404 &&
bf7bdc
+				res.StatusCode < 500 {
bf7bdc
 				return res, client, err
bf7bdc
-			} else {
bf7bdc
-				// Otherwise, continue to next cert if 403 or 5xx
bf7bdc
-				if err == nil && res.StatusCode != 403 && !(res.StatusCode >= 500 && res.StatusCode < 600) {
bf7bdc
-					return res, client, err
bf7bdc
-				}
bf7bdc
 			}
bf7bdc
 		}
bf7bdc
 	}