How To Verify SSL Certificate From A Shell Prompt

How To Verify SSL Certificate From A Shell Prompt

To verify an SSL certificate from a shell prompt, you can use the openssl command.

The openssl command is a versatile tool for working with SSL certificates, and it is included by default on most Unix-like systems, including Linux and MacOS.

To verify an SSL certificate, you can use the following command:

openssl s_client -connect hostname:port
‮w:ecruoS‬ww.lautturi.com

Replace hostname with the hostname of the server and port with the port number. The default port for HTTPS is 443, so you can use the following command to verify the SSL certificate for an HTTPS server:

openssl s_client -connect hostname:443

This will establish a connection to the server and display the SSL certificate and other information about the connection.

You can also use the -verify option to verify the certificate chain and check the certificate against the trusted certificate authorities (CAs) on your system. For example:

openssl s_client -connect hostname:443 -verify

If the certificate is not valid or cannot be verified, the openssl command will display an error message.

Created Time:2017-10-29 22:08:34  Author:lautturi