yum fails with error: Peer cert cannot be verified or peer cert invalid" or 'certificate verify failed`

Solution Verified - Updated -

Issue

  • Yum commands fails with error:
Error: failed to retrieve repodata/<long-string>-primary.xml.gz from rhel-x86_64-server-6
error was [Errno 14] Peer cert cannot be verified or peer cert invalid
  • Performing a yum check-update produces the following error when registered to Red Hat Subscription Manager.
[root@rserver ~]# yum check-update
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is receiving updates from Red Hat Subscription Management.
https://cdn.redhat.com/content/dist/rhel/server/6///optional/os/repodata/repomd.xml: [Errno 14] Peer cert cannot be verified or peer cert invalid
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: example_repo1. Please verify its path and try again
  • Certificate related errors can also be caused by running other related yum commands such as:
yum repolist
yum update
yum search
yum list

or it may even come before the registration occurs
subscription-manager register

This commands may produce the error such as:
unable to verify servers identity: certificate verify failed

Environment

  • Red Hat Enterprise Linux 5.x
  • Red Hat Enterprise Linux 6.x
  • Red Hat Enterprise Linux 7.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