openssl-s_client:tldr:c6144
openssl-s_client: Display the complete certificate chain of an HTTPS server.
$ openssl s_client -connect ${host}:443 -showcerts
try on your machine
This command is used to establish a secure SSL/TLS connection with a server and retrieve its SSL certificate. Let's break it down:
opensslis the command-line tool used for various cryptographic operations, including SSL/TLS.s_clientis a subcommand in OpenSSL that allows the client (your machine) to connect to an SSL/TLS server.-connect ${host}:443specifies the server's address and port to which the client should connect. This command assumes thehostvariable holds the domain name or IP address of the server.:443is the default port used for secure HTTPS communication.-showcertstellss_clientto display the server's SSL certificate(s) as part of the output.</dev/nullis a shell redirection that provides an empty input to thes_clientcommand. This is done to prevent any potential interference from user input, ass_clienttypically waits for user input interactively.
Overall, this command establishes a connection to a server, retrieves the SSL certificate(s) presented by the server, and displays them on the terminal.
This explanation was created by an AI. In most cases those are correct. But please always be careful and
never run a command you are not sure if it is safe.