How To Install python-backports-ssl_match_hostname on CentOS 7

In this tutorial we learn how to install python-backports-ssl_match_hostname on CentOS 7. python-backports-ssl_match_hostname is The ssl.match_hostname() function from Python 3

Introduction

In this tutorial we learn how to install python-backports-ssl_match_hostname on CentOS 7.

What is python-backports-ssl_match_hostname

The Secure Sockets layer is only actually secure if you check the hostname in the certificate returned by the server to which you are connecting, and verify that it matches to hostname that you are trying to reach. But the matching logic, defined in RFC2818, can be a bit tricky to implement on your own. So the ssl package in the Standard Library of Python 3.2 now includes a match_hostname() function for performing this check instead of requiring every application to implement the check separately. This backport brings match_hostname() to users of earlier versions of Python. The actual code is only slightly modified from Python 3.5.

We can use yum or dnf to install python-backports-ssl_match_hostname on CentOS 7. In this tutorial we discuss both methods but you only need to choose one of method to install python-backports-ssl_match_hostname.

Install python-backports-ssl_match_hostname on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install python-backports-ssl_match_hostname using yum by running the following command:

sudo yum -y install python-backports-ssl_match_hostname

Install python-backports-ssl_match_hostname on CentOS 7 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

After updating yum database, We can install python-backports-ssl_match_hostname using dnf by running the following command:

sudo dnf -y install python-backports-ssl_match_hostname

How To Uninstall python-backports-ssl_match_hostname on CentOS 7

To uninstall only the python-backports-ssl_match_hostname package we can use the following command:

sudo dnf remove python-backports-ssl_match_hostname

References

Summary

In this tutorial we learn how to install python-backports-ssl_match_hostname on CentOS 7 using yum and dnf.