LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

openssl-s_client

TLS/SSL client for testing and debugging connections

TLDR

Connect to HTTPS server
$ openssl s_client -connect [example.com]:443
copy
Connect with SNI
$ openssl s_client -connect [example.com]:443 -servername [example.com]
copy
Show certificate chain
$ openssl s_client -connect [example.com]:443 -showcerts
copy
Connect to SMTP with STARTTLS
$ openssl s_client -connect [mail.example.com]:587 -starttls smtp
copy
Verify certificate
$ openssl s_client -connect [example.com]:443 -verify_return_error
copy
Test specific protocol
$ openssl s_client -connect [example.com]:443 -tls1_3
copy

SYNOPSIS

openssl s_client [options] -connect host:port

DESCRIPTION

openssl s_client is a TLS/SSL client for testing and debugging connections. It establishes SSL/TLS connections and displays certificate and connection information.After connecting, you can type protocol commands (HTTP, SMTP, etc.).

PARAMETERS

-connect host:port

Server to connect to.
-servername name
SNI hostname.
-showcerts
Show certificate chain.
-starttls proto
STARTTLS protocol.
-verify depth
Verify depth.
-CAfile file
CA certificates.
-tls1_2, -tls1_3
Specific TLS version.
-cipher list
Cipher list.

EXAMPLE

$ # Test HTTPS
openssl s_client -connect example.com:443 <<< "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
copy

INSTALL

sudo apt install openssl
copy
sudo dnf install openssl
copy
sudo pacman -S openssl
copy
sudo apk add openssl
copy
sudo zypper install openssl
copy
brew install openssl
copy
nix profile install nixpkgs#openssl
copy

CAVEATS

Interactive by default; use <<< or EOF for scripting. Certificate verification may fail without CAfile.

HISTORY

s_client has been part of OpenSSL since early versions, essential for SSL/TLS testing and debugging.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid