![Forrest logo](/images/logo.png)
openssl-s_client:tldr:0f40d
openssl-s_client: Display the certificate presented by an SSL/TLS server.
$ openssl s_client -connect ${host}:${port}
try on your machine
The command "openssl s_client -connect ${host}:${port} </dev/null" is used to establish a secure connection with an SSL/TLS server.
Here's a breakdown of the command:
- "openssl" is the command to invoke the OpenSSL toolkit.
- "s_client" is a subcommand of OpenSSL that allows it to act as a client for SSL/TLS connections.
- "-connect ${host}:${port}" is a flag that specifies the target server's hostname (in the ${host} variable) and port number (in the ${port} variable). The actual values for ${host} and ${port} should be provided or substituted accordingly.
- "</dev/null" is used to redirect the standard input stream (stdin) of the command to null. This is done to prevent OpenSSL from the client console for user input, as it is not needed in this case.
By executing this command, OpenSSL will attempt to connect to the specified server using the SSL/TLS protocol on the provided hostname and port. It will then display the SSL handshake process, certificate details, and other information related to the secure connection.
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.