Show the negotiated TLS protocol, cipher, and peer certificate
Build a paste-ready command, then review its compatibility and effects before running it.
openssl s_client -brief -connect <host>:<port> -servername <host> </dev/null 2>&1 | rg 'Protocol|Ciphersuite|Peer certificate|Verification'Complete required fields to copy the generated command.
Compatibility
Linux + macOSVerified for Linux, macOS using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementsopensslopenssl must be installed and available on PATH.Network accessThe target must be reachable from the current environment.
Version supportopenssl Current supported releasesVerified for linux, macos using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsProtocol version: TLSv1.3Representative successful output; values vary with the selected target and system state.
Known errorsopenssl: command not foundopenssl is missing or is not available on PATH.
Verifyopenssl s_client -brief -connect {{host}}:{{port}} -servername {{host}} </dev/null 2>&1 | rg 'Protocol|Ciphersuite|Peer certificate|Verification'The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01opensslCommandRuns the openssl stage of this one-liner.
02s_clientArgumentPasses s_client to openssl.
03-briefOptionConfigures openssl with the -brief option.
04-connectOptionConfigures openssl with the -connect option.
05<host>:ParameterA value supplied in the Fill parameters section.
06<port>ParameterA value supplied in the Fill parameters section.
07-servernameOptionConfigures openssl with the -servername option.
08<host>ParameterA value supplied in the Fill parameters section.
09<RedirectionRedirects command input, standard output, or error output.
10/dev/nullArgumentPasses /dev/null to openssl.
112>&1RedirectionRedirects command input, standard output, or error output.
12|PipelinePasses the output on the left to the command on the right.
13rgCommandRuns the rg stage of this one-liner.
14'Protocol|Ciphersuite|Peer certificate|Verification'ArgumentPasses 'Protocol|Ciphersuite|Peer certificate|Verification' to rg.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
openssl s_client -brief -connect example.com:443 -servername example.com </dev/null 2>&1 | rg 'Protocol|Ciphersuite|Peer certificate|Verification'
Example output
Protocol version: TLSv1.3
Ciphersuite: TLS_AES_256_GCM_SHA384
Peer certificate: CN = example.com
Verification: OK
Illustrative output — exact values vary by system and data.
Official sources