How to check SSL certificate expiration date in Unix?
Last updated: Feb 11, 2026. Verify the SSL certificate on your web server is valid or not. Do that by using this simple script. It is a small bash script written to display all the details of SSL certificates on your system. The script can be run on both Solaris and Linux operating systems.
The script accepts certificate information either by passing it as a command-line argument or read from the standard input. The output shows details of the certificate including the server name, the Common Name, the expiration date, the issuer, the serial number, and whether the certificate is signed by a trusted CYou can even verify if the certificate is self-signed. You can either accept the default values for the command-line arguments or enter them as you wish. To validate an SSL certificate, first you need to install the SSL certificates on the server. Then run the script. Gstsslcertificatedetails
This command outputs certificate information. The certificate information is written to a file called /dev/null.
#!p12 -nodes certif'
Related Answers
What is TLS/SSL Protocol?
TLS stands for Transport Layer Security and it is a protocol used to create a secure connect...
Which is more secure SSL TLS or HTTPS?
and SSL? I know the difference between TCP/IP vs. IP, or S...
Is SSL TLS certificate free?
If you are going to use the certificate in production environment, I sugg...