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

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