oc-mirror Uses HTTP Instead of HTTPS by Default in RHOCP 4.17

Solution Verified - Updated -

Issue

The oc-mirror tool, used to mirror container images to a registry, incorrectly defaults to using HTTP instead of HTTPS. This causes a 400 Bad Request error when attempting to mirror images to an HTTPS-enabled registry.

Error Message

error: error checking push permissions for mirror-registry.local:8443: creating push check transport for mirror-registry.local:8443 failed: GET http://mirror-registry.local:8443/v2/: unexpected status code 400 Bad Request
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx/1.20.1</center>
</body>
</html>

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
  • (4.17 and earlier)
  • oc-mirror v1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content