Yum command fails with curl error that ends in "[SSL: no alternative certificate subject name matches target host name 'proxy_IP/hostname']"

Solution Verified - Updated -

Issue

  • Yum command fails with below error:-
#  yum update
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs)                                                                                   0.0  B/s |   0  B     00:01
Errors during downloading metadata for repository 'rhel-8-for-x86_64-baseos-rpms':
  - Curl error (51): SSL peer certificate or SSH remote key was not OK for https://cdn.redhat.com/content/dist/rhel8/8/x86_64/baseos/os/repodata/repomd.xml [SSL: no alternative certificate subject name matches target host name 'xx.xxx.xxx.xx']
Error: Failed to download metadata for repo 'rhel-8-for-x86_64-baseos-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.

# yum update
Updating Subscription Management repositories.
Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs)                                                                                          0.0  B/s |   0  B     00:01
Errors during downloading metadata for repository 'rhel-9-for-x86_64-baseos-rpms':
  - Curl error (60): SSL peer certificate or SSH remote key was not OK for https://cdn.redhat.com/content/dist/rhel9/9/x86_64/baseos/os/repodata/repomd.xml [SSL: no alternative certificate subject name matches target host name 'xxx.xxx.xxx.xxx']
Error: Failed to download metadata for repo 'rhel-9-for-x86_64-baseos-rpms': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried.

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9

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