Error creating TLS secret

Solution Verified - Updated -

Issue

When creating a secret for a TLS certificate the following error is thrown.

$ oc create secret tls <name>-tls --cert=fullchain.pem --key=privkey.pem -n <my_project>

[spec.tls.key: Invalid value: "redacted key data": unrecognized PEM block ENCRYPTED PRIVATE KEY, spec.tls.key: Invalid value: "redacted key data": tls: failed to parse private key]

Environment

  • Red Hat OpenShift on AWS [ROSA]
    • 4.x
  • Red Hat OpenShift Dedicated [OSD]
    • 4.x
  • Red Hat OpenShift on Azure [ARO]
    • 4.x
  • Red Hat OpenShift Container Platform [OCP]
    • 4.x

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