How to check certificate information of web server using openssl

In this article we will see how to check certificate information of webserver using command line tool openssl

The below command will get you the valid period of the ssl certificate.

To check the certificate information of web server, use the following command. Here I’m using google.com in this example

Export certificate into a file

If you want to extract the public key from the certificate, here is how you can do

 

References:
[1] Certificates and Encodings