Files
GmSSL/doc/apps/s_client.pod
Liu Shaotong 480b9e8d88 translation
2017-07-19 15:39:07 +08:00

767 lines
28 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
=pod
=encoding utf8
=head1 NAME
s_client - SSL/TLS client program
=head1 SYNOPSIS
B<gmssl> B<s_client>
[B<-help>]
[B<-connect host:port>]
[B<-proxy host:port>]
[B<-unix path>]
[B<-4>]
[B<-6>]
[B<-servername name>]
[B<-verify depth>]
[B<-verify_return_error>]
[B<-cert filename>]
[B<-certform DER|PEM>]
[B<-key filename>]
[B<-keyform DER|PEM>]
[B<-pass arg>]
[B<-CApath directory>]
[B<-CAfile filename>]
[B<-no-CAfile>]
[B<-no-CApath>]
[B<-dane_tlsa_domain domain>]
[B<-dane_tlsa_rrdata rrdata>]
[B<-dane_ee_no_namechecks>]
[B<-attime timestamp>]
[B<-check_ss_sig>]
[B<-crl_check>]
[B<-crl_check_all>]
[B<-explicit_policy>]
[B<-extended_crl>]
[B<-ignore_critical>]
[B<-inhibit_any>]
[B<-inhibit_map>]
[B<-no_check_time>]
[B<-partial_chain>]
[B<-policy arg>]
[B<-policy_check>]
[B<-policy_print>]
[B<-purpose purpose>]
[B<-suiteB_128>]
[B<-suiteB_128_only>]
[B<-suiteB_192>]
[B<-trusted_first>]
[B<-no_alt_chains>]
[B<-use_deltas>]
[B<-auth_level num>]
[B<-verify_depth num>]
[B<-verify_email email>]
[B<-verify_hostname hostname>]
[B<-verify_ip ip>]
[B<-verify_name name>]
[B<-x509_strict>]
[B<-reconnect>]
[B<-showcerts>]
[B<-debug>]
[B<-msg>]
[B<-nbio_test>]
[B<-state>]
[B<-nbio>]
[B<-crlf>]
[B<-ign_eof>]
[B<-no_ign_eof>]
[B<-quiet>]
[B<-ssl3>]
[B<-tls1>]
[B<-tls1_1>]
[B<-tls1_2>]
[B<-tls1_3>]
[B<-no_ssl3>]
[B<-no_tls1>]
[B<-no_tls1_1>]
[B<-no_tls1_2>]
[B<-no_tls1_3>]
[B<-dtls>]
[B<-dtls1>]
[B<-dtls1_2>]
[B<-fallback_scsv>]
[B<-async>]
[B<-split_send_frag>]
[B<-max_pipelines>]
[B<-read_buf>]
[B<-bugs>]
[B<-comp>]
[B<-no_comp>]
[B<-cipher cipherlist>]
[B<-serverpref>]
[B<-starttls protocol>]
[B<-xmpphost hostname>]
[B<-engine id>]
[B<-tlsextdebug>]
[B<-no_ticket>]
[B<-sess_out filename>]
[B<-sess_in filename>]
[B<-rand file(s)>]
[B<-serverinfo types>]
[B<-status>]
[B<-alpn protocols>]
[B<-nextprotoneg protocols>]
[B<-ct|noct>]
[B<-ctlogfile>]
=head1 DESCRIPTION
The B<s_client> command implements a generic SSL/TLS client which connects
to a remote host using SSL/TLS. It is a I<very> useful diagnostic tool for
SSL servers.
s_client命令实现使用SSL / TLS连接到远程主机的通用SSL / TLS客户端。 它是SSL服务器非常有用的诊断工具。
=head1 OPTIONS
In addition to the options below the B<s_client> utility also supports the
common and client only options documented in the
in the "Supported Command Line Commands" section of the L<SSL_CONF_cmd(3)>
manual page.
除了以下选项之外s_client实用程序还支持SSL_CONF_cmd3手册页的“支持的命令行命令”部分中记录的通用和客户端选项。
=over 4
=item B<-help>
Print out a usage message.
输出使用信息。
=item B<-connect host:port>
This specifies the host and optional port to connect to. If not specified
then an attempt is made to connect to the local host on port 4433.
这指定要连接的主机和可选端口。 如果未指定则尝试连接到端口4433上的本地主机。
=item B<-proxy host:port>
When used with the B<-connect> flag, the program uses the host and port
specified with this flag and issues an HTTP CONNECT command to connect
to the desired server.
当与-connect标志一起使用时程序使用由该标志指定的主机和端口并发出HTTP CONNECT命令连接到所需的服务器。
=item B<-unix path>
Connect over the specified Unix-domain socket.
连接指定的Unix域套接字。
=item B<-4>
Use IPv4 only.
仅使用IPv4。
=item B<-6>
Use IPv6 only.
仅使用IPv6.
=item B<-servername name>
Set the TLS SNI (Server Name Indication) extension in the ClientHello message.
在ClientHello消息中设置TLS SNI服务器名称指示扩展。
=item B<-cert certname>
The certificate to use, if one is requested by the server. The default is
not to use a certificate.
要使用的证书,如果是服务器请求的。 默认情况下不使用证书。
=item B<-certform format>
The certificate format to use: DER or PEM. PEM is the default.
使用的证书格式DER或PEM。 PEM是默认值。
=item B<-key keyfile>
The private key to use. If not specified then the certificate file will
be used.
使用私钥。 如果未指定,则将使用证书文件。
=item B<-keyform format>
The private format to use: DER or PEM. PEM is the default.
要使用的私有格式DER或PEM。 PEM是默认值。
=item B<-pass arg>
the private key password source. For more information about the format of B<arg>
see the B<PASS PHRASE ARGUMENTS> section in L<gmssl(1)>.
私钥密码源。 有关arg格式的更多信息请参阅gmssl1中的PASS PHRASE ARGUMENTS部分。
=item B<-verify depth>
The verify depth to use. This specifies the maximum length of the
server certificate chain and turns on server certificate verification.
Currently the verify operation continues after errors so all the problems
with a certificate chain can be seen. As a side effect the connection
will never fail due to a server certificate verify failure.
验证使用深度。 这指定服务器证书链的最大长度,并打开服务器证书验证。
目前,验证操作在错误之后继续,所以可以看到证书链中的所有问题。
作为副作用,由于服务器证书验证失败,连接永远不会失败。
=item B<-verify_return_error>
Return verification errors instead of continuing. This will typically
abort the handshake with a fatal error.
返回验证错误,而不是继续。 这通常会以致命错误中止握手。
=item B<-CApath directory>
The directory to use for server certificate verification. This directory
must be in "hash format", see B<verify> for more information. These are
also used when building the client certificate chain.
用于服务器证书验证的目录。 此目录必须为“哈希格式”,请参阅验证更多信息。 这些也在构建客户端证书链时使用。
=item B<-CAfile file>
A file containing trusted certificates to use during server authentication
and to use when attempting to build the client certificate chain.
包含在服务器认证期间使用并在尝试构建客户端证书链时使用的可信证书的文件。
=item B<-no-CAfile>
Do not load the trusted CA certificates from the default file location
不要从默认文件位置加载受信任的CA证书
=item B<-no-CApath>
Do not load the trusted CA certificates from the default directory location
不要从默认目录位置加载受信任的CA证书
=item B<-dane_tlsa_domain domain>
Enable RFC6698/RFC7671 DANE TLSA authentication and specify the
TLSA base domain which becomes the default SNI hint and the primary
reference identifier for hostname checks. This must be used in
combination with at least one instance of the B<-dane_tlsa_rrdata>
option below.
When DANE authentication succeeds, the diagnostic output will include
the lowest (closest to 0) depth at which a TLSA record authenticated
a chain certificate. When that TLSA record is a "2 1 0" trust
anchor public key that signed (rather than matched) the top-most
certificate of the chain, the result is reported as "TA public key
verified". Otherwise, either the TLSA record "matched TA certificate"
at a positive depth or else "matched EE certificate" at depth 0.
启用RFC6698 / RFC7671 DANE TLSA身份验证并指定成为默认SNI提示的TLSA基本域和主机名检查的主参考标识符。
这必须与以下-dane_tlsa_rrdata选项的至少一个实例结合使用。
当DANE认证成功时诊断输出将包括TLSA记录认证链式证书的最低最接近0深度。
当该TLSA记录是一个“2 1 0”信任锚公钥该信任锚公钥是签名而不是匹配链中最顶层的证书
结果被报告为“TA公钥验证”。 否则TLSA记录“匹配的TA证书”在深度为深度否则“匹配的EE证书”在深度0。
=item B<-dane_tlsa_rrdata rrdata>
Use one or more times to specify the RRDATA fields of the DANE TLSA
RRset associated with the target service. The B<rrdata> value is
specied in "presentation form", that is four whitespace separated
fields that specify the usage, selector, matching type and associated
data, with the last of these encoded in hexadecimal. Optional
whitespace is ignored in the associated data field. For example:
使用一次或多次来指定与目标服务相关联的DANE TLSA RRset的RRDATA字段。
rrdata值以“表示形式”指定即指定使用选择器匹配类型和关联数据的
四个空白分隔字段,其中最后一个以十六进制编码。 可选的空格在关联的数据字段中被忽略。 例如:
$ gmssl s_client -brief -starttls smtp \
-connect smtp.example.com:25 \
-dane_tlsa_domain smtp.example.com \
-dane_tlsa_rrdata "2 1 1
B111DD8A1C2091A89BD4FD60C57F0716CCE50FEEFF8137CDBEE0326E 02CF362B" \
-dane_tlsa_rrdata "2 1 1
60B87575447DCBA2A36B7D11AC09FB24A9DB406FEE12D2CC90180517 616E8A18"
...
Verification: OK
Verified peername: smtp.example.com
DANE TLSA 2 1 1 ...ee12d2cc90180517616e8a18 matched TA certificate at depth 1
...
=item B<-dane_ee_no_namechecks>
This disables server name checks when authenticating via DANE-EE(3) TLSA
records.
For some applications, primarily web browsers, it is not safe to disable name
checks due to "unknown key share" attacks, in which a malicious server can
convince a client that a connection to a victim server is instead a secure
connection to the malicious server.
The malicious server may then be able to violate cross-origin scripting
restrictions.
Thus, despite the text of RFC7671, name checks are by default enabled for
DANE-EE(3) TLSA records, and can be disabled in applications where it is safe
to do so.
In particular, SMTP and XMPP clients should set this option as SRV and MX
records already make it possible for a remote domain to redirect client
connections to any server of its choice, and in any case SMTP and XMPP clients
do not execute scripts downloaded from remote servers.
当通过DANE-EE3TLSA记录进行身份验证时这将禁用服务器名称检查。
对于某些应用程序主要是Web浏览器由于“未知密钥共享”攻击禁用名称检查是
不安全的,恶意服务器可以说服客户端与受害者服务器的连接而不是与恶意服务器的安全
连接。 恶意服务器可能能够违反跨原始脚本限制。 因此尽管RFC7671的文本默认情
况下对DANE-EE3TLSA记录启用名称检查并且可以在安全的应用程序中禁用名称检查。
特别是SMTP和XMPP客户端应该将此选项设置为SRV和MX记录使远程域可以将客户端连接
重定向到所选的任何服务器无论如何SMTP和XMPP客户端不会执行从远程服务器下载的脚本服务器。
=item B<-attime>, B<-check_ss_sig>, B<-crl_check>, B<-crl_check_all>,
B<-explicit_policy>, B<-extended_crl>, B<-ignore_critical>, B<-inhibit_any>,
B<-inhibit_map>, B<-no_alt_chains>, B<-no_check_time>, B<-partial_chain>, B<-policy>,
B<-policy_check>, B<-policy_print>, B<-purpose>, B<-suiteB_128>,
B<-suiteB_128_only>, B<-suiteB_192>, B<-trusted_first>, B<-use_deltas>,
B<-auth_level>, B<-verify_depth>, B<-verify_email>, B<-verify_hostname>,
B<-verify_ip>, B<-verify_name>, B<-x509_strict>
Set various certificate chain validation options. See the
L<verify(1)> manual page for details.
=item B<-reconnect>
reconnects to the same server 5 times using the same session ID, this can
be used as a test that session caching is working.
使用相同的会话ID重新连接到相同的服务器5次这可以用作会话缓存正在工作的测试。
=item B<-showcerts>
display the whole server certificate chain: normally only the server
certificate itself is displayed.
显示整个服务器证书链:通常只显示服务器证书本身。
=item B<-prexit>
print session information when the program exits. This will always attempt
to print out information even if the connection fails. Normally information
will only be printed out once if the connection succeeds. This option is useful
because the cipher in use may be renegotiated or the connection may fail
because a client certificate is required or is requested only after an
attempt is made to access a certain URL. Note: the output produced by this
option is not always accurate because a connection might never have been
established.
当程序退出时打印会话信息。 即使连接失败,它也将始终尝试打印出信息。 通常,
如果连接成功,信息将仅打印一次。 此选项非常有用,因为正在使用的密码可能被
重新协商或连接可能会失败因为客户端证书是必需的或仅在尝试访问某个URL
后才被请求。 注意:此选项生成的输出并不总是准确的,因为连接可能永远不会建立。
=item B<-state>
prints out the SSL session states.
打印出SSL会话状态。
=item B<-debug>
print extensive debugging information including a hex dump of all traffic.
打印广泛的调试信息,包括所有流量的十六进制转储。
=item B<-msg>
show all protocol messages with hex dump.
显示所有具有十六进制转储的协议消息。
=item B<-trace>
show verbose trace output of protocol messages. GmSSL needs to be compiled
with B<enable-ssl-trace> for this option to work.
显示协议消息的详细跟踪输出。 需要使用enable-ssl-trace编译GmSSL才能使此选项生效。
=item B<-msgfile>
file to send output of B<-msg> or B<-trace> to, default standard output.
文件将-msg或-trace的输出发送到默认标准输出。
=item B<-nbio_test>
tests non-blocking I/O
测试非阻塞I / O
=item B<-nbio>
turns on non-blocking I/O
打开非阻塞I / O
=item B<-crlf>
this option translated a line feed from the terminal into CR+LF as required
by some servers.
该选项根据某些服务器的要求将终端转换为CR + LF。
=item B<-ign_eof>
inhibit shutting down the connection when end of file is reached in the
input.
禁止在输入端到达文件结束时关闭连接。
=item B<-quiet>
inhibit printing of session and certificate information. This implicitly
turns on B<-ign_eof> as well.
禁止打印会话和证书信息。 这也隐含地打开-ign_eof。
=item B<-no_ign_eof>
shut down the connection when end of file is reached in the input.
Can be used to override the implicit B<-ign_eof> after B<-quiet>.
在输入端到达文件结束时关闭连接。 可以用于在-quiet之后覆盖隐式的-ign_eof。
=item B<-psk_identity identity>
Use the PSK identity B<identity> when using a PSK cipher suite.
使用PSK密码套件时使用PSK身份标识。
=item B<-psk key>
Use the PSK key B<key> when using a PSK cipher suite. The key is
given as a hexadecimal number without leading 0x, for example -psk
1a2b3c4d.
使用PSK密码套件时请使用PSK密钥。 密钥以十六进制数字的形式给出不带前缀0x例如-psk 1a2b3c4d。
=item B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-tls1_3>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>, B<-no_tls1_3>
These options require or disable the use of the specified SSL or TLS protocols.
By default B<s_client> will negotiate the highest mutually supported protocol
version.
When a specific TLS version is required, only that version will be offered to
and accepted from the server.
这些选项需要或禁止使用指定的SSL或TLS协议。 默认情况下s_client将协商最高相互
支持的协议版本。 当需要特定的TLS版本时只有该版本将被提供给服务器并从服务器接受。
=item B<-dtls>, B<-dtls1>, B<-dtls1_2>
These options make B<s_client> use DTLS protocols instead of TLS.
With B<-dtls>, B<s_client> will negotiate any supported DTLS protocol version,
whilst B<-dtls1> and B<-dtls1_2> will only support DTLS1.0 and DTLS1.2
respectively.
这些选项使s_client使用DTLS协议而不是TLS。 使用-dtlss_client将协商任何支持的
DTLS协议版本而-dtls1和-dtls1_2将分别仅支持DTLS1.0和DTLS1.2。
=item B<-fallback_scsv>
Send TLS_FALLBACK_SCSV in the ClientHello.
在ClientHello中发送TLS_FALLBACK_SCSV。
=item B<-async>
switch on asynchronous mode. Cryptographic operations will be performed
asynchronously. This will only have an effect if an asynchronous capable engine
is also used via the B<-engine> option. For test purposes the dummy async engine
(dasync) can be used (if available).
开启异步模式。 加密操作将被异步执行。 只有通过-engine选项也可以使用异步的引擎
这只会产生影响。 为了测试目的可以使用虚拟异步引擎dasync如果可用
=item B<-split_send_frag int>
The size used to split data for encrypt pipelines. If more data is written in
one go than this value then it will be split into multiple pipelines, up to the
maximum number of pipelines defined by max_pipelines. This only has an effect if
a suitable ciphersuite has been negotiated, an engine that supports pipelining
has been loaded, and max_pipelines is greater than 1. See
L<SSL_CTX_set_split_send_fragment(3)> for further information.
用于分割加密管道数据的大小。 如果一次写入的数据多于此值,那么它将被分割成多个管道,
直到max_pipelines定义的最大管道数。 如果已经协商了合适的密码套件,则支持流水线的
引擎已被加载并且max_pipelines大于1.请参阅SSL_CTX_set_split_send_fragment3
以获取更多信息。
=item B<-max_pipelines int>
The maximum number of encrypt/decrypt pipelines to be used. This will only have
an effect if an engine has been loaded that supports pipelining (e.g. the dasync
engine) and a suitable ciphersuite has been negotiated. The default value is 1.
See L<SSL_CTX_set_max_pipelines(3)> for further information.
要使用的加密/解密管道的最大数量。 如果已经加载支持流水线的引擎例如dasync引擎
并且已经协商了合适的密码套件,则这将仅起作用。 默认值为1.有关更多信息,请参阅
SSL_CTX_set_max_pipelines3
=item B<-read_buf int>
The default read buffer size to be used for connections. This will only have an
effect if the buffer size is larger than the size that would otherwise be used
and pipelining is in use (see L<SSL_CTX_set_default_read_buffer_len(3)> for
further information).
用于连接的默认读缓冲区大小。 如果缓冲区大小大于使用的流水线大小(如果需要进一步的信息,
请参阅SSL_CTX_set_default_read_buffer_len3这只会产生影响。
=item B<-bugs>
there are several known bug in SSL and TLS implementations. Adding this
option enables various workarounds.
SSL和TLS实现中有几个已知的错误。 添加此选项可以启用各种解决方法。
=item B<-comp>
Enables support for SSL/TLS compression.
This option was introduced in GmSSL 1.1.0.
TLS compression is not recommended and is off by default as of
GmSSL 1.1.0.
支持SSL / TLS压缩。 此选项在GmSSL 1.1.0中引入。 不推荐使用TLS压缩
默认情况下GmSSL 1.1.0关闭。
=item B<-no_comp>
Disables support for SSL/TLS compression.
TLS compression is not recommended and is off by default as of
GmSSL 1.1.0.
禁用对SSL / TLS压缩的支持。 不推荐使用TLS压缩默认情况下GmSSL 1.1.0关闭。
=item B<-brief>
only provide a brief summary of connection parameters instead of the
normal verbose output.
只提供连接参数的简要摘要,而不是正常的详细输出。
=item B<-cipher cipherlist>
this allows the cipher list sent by the client to be modified. Although
the server determines which cipher suite is used it should take the first
supported cipher in the list sent by the client. See the B<ciphers>
command for more information.
这允许客户端发送的密码列表被修改。 虽然服务器确定使用哪个密码套件,
但它应该在客户端发送的列表中使用第一个支持的密码。 有关详细信息请参阅ciphers命令。
=item B<-starttls protocol>
send the protocol-specific message(s) to switch to TLS for communication.
B<protocol> is a keyword for the intended protocol. Currently, the only
supported keywords are "smtp", "pop3", "imap", "ftp", "xmpp", "xmpp-server",
and "irc."
发送特定于协议的消息切换到TLS进行通信。 协议是目标协议的关键字。 目前,
唯一支持的关键字是“smtp”“pop3”“imap”“ftp”“xmpp”“xmpp-server”和“irc”。
=item B<-xmpphost hostname>
This option, when used with "-starttls xmpp" or "-starttls xmpp-server",
specifies the host for the "to" attribute of the stream element.
If this option is not specified, then the host specified with "-connect"
will be used.
此选项与“-starttls xmpp”或“-starttls xmpp-server”一起使用时指定流元素
“to”属性的主机。 如果未指定此选项,则将使用“-connect”指定的主机。
=item B<-tlsextdebug>
print out a hex dump of any TLS extensions received from the server.
打印从服务器接收的任何TLS扩展的十六进制转储。
=item B<-no_ticket>
disable RFC4507bis session ticket support.
禁用RFC4507bis会话票证支持。
=item B<-sess_out filename>
output SSL session to B<filename>
输出SSL会话到filename
=item B<-sess_in sess.pem>
load SSL session from B<filename>. The client will attempt to resume a
connection from this session.
从filename加载SSL会话。 客户端将尝试从此会话恢复连接。
=item B<-engine id>
specifying an engine (by its unique B<id> string) will cause B<s_client>
to attempt to obtain a functional reference to the specified engine,
thus initialising it if needed. The engine will then be set as the default
for all available algorithms.
指定引擎通过其唯一的id字符串将导致s_client尝试获取对指定引擎的功能引用从而在需要时对其进行初始化。 然后,引擎将被设置为所有可用算法的默认值。
=item B<-rand file(s)>
a file or files containing random data used to seed the random number
generator, or an EGD socket (see L<RAND_egd(3)>).
Multiple files can be specified separated by an OS-dependent character.
The separator is B<;> for MS-Windows, B<,> for OpenVMS, and B<:> for
all others.
包含用于种子随机数生成器或EGD套接字的随机数据的文件或文件参见RAND_egd3。 多个文件可以由与操作系统相关的字符分隔。 分离器是 对于MS-Windows对于OpenVMS以及对于所有其他。
=item B<-serverinfo types>
a list of comma-separated TLS Extension Types (numbers between 0 and
65535). Each type will be sent as an empty ClientHello TLS Extension.
The server's response (if any) will be encoded and displayed as a PEM
file.
逗号分隔的TLS扩展类型列表0到65535之间的数字。 每个类型将作为一个空的ClientHello TLS扩展发送。 服务器的响应如果有将被编码并显示为PEM文件。
=item B<-status>
sends a certificate status request to the server (OCSP stapling). The server
response (if any) is printed out.
向服务器发送证书状态请求OCSP装订。 打印出服务器响应(如果有)。
=item B<-alpn protocols>, B<-nextprotoneg protocols>
these flags enable the
Enable the Application-Layer Protocol Negotiation or Next Protocol
Negotiation extension, respectively. ALPN is the IETF standard and
replaces NPN.
The B<protocols> list is a
comma-separated protocol names that the client should advertise
support for. The list should contain most wanted protocols first.
Protocol names are printable ASCII strings, for example "http/1.1" or
"spdy/3".
Empty list of protocols is treated specially and will cause the client to
advertise support for the TLS extension but disconnect just after
receiving ServerHello with a list of server supported protocols.
这些标志分别启用启用应用层协议协商协议或下一协议协议扩展。 ALPN是IETF标准替代NPN。 协议列表是客户端应该广告支持的逗号分隔的协议名称。 该列表应该包含最需要的协议。 协议名称是可打印的ASCII字符串例如“http / 1.1”或“spdy / 3”。 协议的空列表被特别处理并且将导致客户端向TLS扩展发布支持但是在使用服务器支持的协议列表接收ServerHello之后断开连接。
=item B<-ct|noct>
Use one of these two options to control whether Certificate Transparency (CT)
is enabled (B<-ct>) or disabled (B<-noct>).
If CT is enabled, signed certificate timestamps (SCTs) will be requested from
the server and reported at handshake completion.
Enabling CT also enables OCSP stapling, as this is one possible delivery method
for SCTs.
使用这两个选项之一来控制是否启用证书透明度CT或禁用-noct。 如果启用CT将从服务器请求签名的证书时间戳SCT并在握手完成时报告。
启用CT还可以实现OCSP装订因为这是SCT的一种可能的传送方式。
=item B<-ctlogfile>
A file containing a list of known Certificate Transparency logs. See
L<SSL_CTX_set_ctlog_list_file(3)> for the expected file format.
包含已知证书透明度日志列表的文件。 有关预期的文件格式请参阅SSL_CTX_set_ctlog_list_file3
=back
=head1 CONNECTED COMMANDS
If a connection is established with an SSL server then any data received
from the server is displayed and any key presses will be sent to the
server. When used interactively (which means neither B<-quiet> nor B<-ign_eof>
have been given), the session will be renegotiated if the line begins with an
B<R>, and if the line begins with a B<Q> or if end of file is reached, the
connection will be closed down.
=head1 NOTES
B<s_client> can be used to debug SSL servers. To connect to an SSL HTTP
server the command:
gmssl s_client -connect servername:443
would typically be used (https uses port 443). If the connection succeeds
then an HTTP command can be given such as "GET /" to retrieve a web page.
If the handshake fails then there are several possible causes, if it is
nothing obvious like no client certificate then the B<-bugs>,
B<-ssl3>, B<-tls1>, B<-no_ssl3>, B<-no_tls1> options can be tried
in case it is a buggy server. In particular you should play with these
options B<before> submitting a bug report to an GmSSL mailing list.
A frequent problem when attempting to get client certificates working
is that a web client complains it has no certificates or gives an empty
list to choose from. This is normally because the server is not sending
the clients certificate authority in its "acceptable CA list" when it
requests a certificate. By using B<s_client> the CA list can be viewed
and checked. However some servers only request client authentication
after a specific URL is requested. To obtain the list in this case it
is necessary to use the B<-prexit> option and send an HTTP request
for an appropriate page.
If a certificate is specified on the command line using the B<-cert>
option it will not be used unless the server specifically requests
a client certificate. Therefor merely including a client certificate
on the command line is no guarantee that the certificate works.
If there are problems verifying a server certificate then the
B<-showcerts> option can be used to show the whole chain.
The B<s_client> utility is a test tool and is designed to continue the
handshake after any certificate verification errors. As a result it will
accept any certificate chain (trusted or not) sent by the peer. None test
applications should B<not> do this as it makes them vulnerable to a MITM
attack. This behaviour can be changed by with the B<-verify_return_error>
option: any verify errors are then returned aborting the handshake.
=head1 BUGS
Because this program has a lot of options and also because some of the
techniques used are rather old, the C source of B<s_client> is rather hard to
read and not a model of how things should be done.
A typical SSL client program would be much simpler.
The B<-prexit> option is a bit of a hack. We should really report
information whenever a session is renegotiated.
=head1 SEE ALSO
L<SSL_CONF_cmd(3)>,
L<sess_id(1)>, L<s_server(1)>, L<ciphers(1)>
=head1 HISTORY
The -no_alt_chains options was first added to GmSSL 1.1.0.
=head1 COPYRIGHT
Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the GmSSL license (the "License"). You may not use
this file except in compliance with the License. You can obtain a copy
in the file LICENSE in the source distribution or at
L<https://www.openssl.org/source/license.html>.
=cut