How To Install python2-backports-ssl_match_hostname on AlmaLinux 8

In this tutorial we learn how to install python2-backports-ssl_match_hostname in AlmaLinux 8. python2-backports-ssl_match_hostname is The ssl.match_hostname() function from Python 3

Introduction

In this tutorial we learn how to install python2-backports-ssl_match_hostname on AlmaLinux 8.

What is python2-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 python2-backports-ssl_match_hostname on AlmaLinux 8. In this tutorial we discuss both methods but you only need to choose one of method to install python2-backports-ssl_match_hostname.

Install python2-backports-ssl_match_hostname on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install python2-backports-ssl_match_hostname

Install python2-backports-ssl_match_hostname on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install python2-backports-ssl_match_hostname

How To Uninstall python2-backports-ssl_match_hostname on AlmaLinux 8

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

sudo dnf remove python2-backports-ssl_match_hostname

References

Summary

In this tutorial we learn how to install python2-backports-ssl_match_hostname on AlmaLinux 8 using yum and dnf.