← 返回命令列表

Linux command

openssl-s_client 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Connect to HTTPS server

openssl s_client -connect [example.com]:443

Connect with SNI

openssl s_client -connect [example.com]:443 -servername [example.com]

Show certificate chain

openssl s_client -connect [example.com]:443 -showcerts

Connect to SMTP with STARTTLS

openssl s_client -connect [mail.example.com]:587 -starttls smtp

Verify certificate

openssl s_client -connect [example.com]:443 -verify_return_error

Test specific protocol

openssl s_client -connect [example.com]:443 -tls1_3

说明

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.).

参数

-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.

FAQ

What is the openssl-s_client command used for?

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.).

How do I run a basic openssl-s_client example?

Run `openssl s_client -connect [example.com]:443` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -connect _host:port_ do in openssl-s_client?

Server to connect to.