How to Check SSL Certificate in Linux Command Line?

SSL is a very commonly used internet protocol designed for encrypting network traffic and hence enabling secure communication over the network. Whenever SSL is enabled on a website, there is a dedicated SSL certificate associated with it. This certificate contains information like the domain name of the webserver, the name of the certificate-issuing authority, certificate expiration date, etc.

In this article, we will explain to you the method of checking the SSL certificate through the Linux command line. We are using a Linux Mint 20 system to demonstrate this method.

Method of Checking the SSL Certificate in Linux Mint 20 Command Line

For checking the SSL certificate of any desired web server on a specific port number, you will have to execute the following command in your Linux Mint 20 terminal:

$ openssl s_client –showcerts –connect WebServerURL:PortNumber

Here, you will have to replace WebServerURL with the name of the webserver whose SSL certificate you want to verify and PortNumber with the exact port number to which that web server is connected. We have replaced WebServerURL with and PortNumber with 80, as shown in the image below:

The SSL certificate information of the specified web server is shown in the Linux Mint 20 command line in the following image:


By following the method shared with you in this article, you will easily be able to check the SSL certificate of any desired web server through Linux Mint 20 command line. This method is based on a single command; therefore, you will be able to quickly achieve the desired purpose. Moreover, the very same procedure can also be employed on an Ubuntu 20.04 or a Debian 10 system.

About the author

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.