946 lines
34 KiB
HTML
946 lines
34 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of S_CLIENT</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>S_CLIENT</H1>
|
|
Section: OpenSSL (1SSL)<BR>Updated: 2021-03-22<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
openssl-s_client, s_client - SSL/TLS client program
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
<B>openssl</B> <B>s_client</B>
|
|
[<B>-help</B>]
|
|
[<B>-connect host:port</B>]
|
|
[<B>-bind host:port</B>]
|
|
[<B>-proxy host:port</B>]
|
|
[<B>-unix path</B>]
|
|
[<B>-4</B>]
|
|
[<B>-6</B>]
|
|
[<B>-servername name</B>]
|
|
[<B>-noservername</B>]
|
|
[<B>-verify depth</B>]
|
|
[<B>-verify_return_error</B>]
|
|
[<B>-cert filename</B>]
|
|
[<B>-certform DER|PEM</B>]
|
|
[<B>-key filename</B>]
|
|
[<B>-keyform DER|PEM</B>]
|
|
[<B>-cert_chain filename</B>]
|
|
[<B>-build_chain</B>]
|
|
[<B>-xkey</B>]
|
|
[<B>-xcert</B>]
|
|
[<B>-xchain</B>]
|
|
[<B>-xchain_build</B>]
|
|
[<B>-xcertform PEM|DER</B>]
|
|
[<B>-xkeyform PEM|DER</B>]
|
|
[<B>-pass arg</B>]
|
|
[<B>-CApath directory</B>]
|
|
[<B>-CAfile filename</B>]
|
|
[<B>-chainCApath directory</B>]
|
|
[<B>-chainCAfile filename</B>]
|
|
[<B>-no-CAfile</B>]
|
|
[<B>-no-CApath</B>]
|
|
[<B>-requestCAfile filename</B>]
|
|
[<B>-dane_tlsa_domain domain</B>]
|
|
[<B>-dane_tlsa_rrdata rrdata</B>]
|
|
[<B>-dane_ee_no_namechecks</B>]
|
|
[<B>-attime timestamp</B>]
|
|
[<B>-check_ss_sig</B>]
|
|
[<B>-crl_check</B>]
|
|
[<B>-crl_check_all</B>]
|
|
[<B>-explicit_policy</B>]
|
|
[<B>-extended_crl</B>]
|
|
[<B>-ignore_critical</B>]
|
|
[<B>-inhibit_any</B>]
|
|
[<B>-inhibit_map</B>]
|
|
[<B>-no_check_time</B>]
|
|
[<B>-partial_chain</B>]
|
|
[<B>-policy arg</B>]
|
|
[<B>-policy_check</B>]
|
|
[<B>-policy_print</B>]
|
|
[<B>-purpose purpose</B>]
|
|
[<B>-suiteB_128</B>]
|
|
[<B>-suiteB_128_only</B>]
|
|
[<B>-suiteB_192</B>]
|
|
[<B>-trusted_first</B>]
|
|
[<B>-no_alt_chains</B>]
|
|
[<B>-use_deltas</B>]
|
|
[<B>-auth_level num</B>]
|
|
[<B>-nameopt option</B>]
|
|
[<B>-verify_depth num</B>]
|
|
[<B>-verify_email email</B>]
|
|
[<B>-verify_hostname hostname</B>]
|
|
[<B>-verify_ip ip</B>]
|
|
[<B>-verify_name name</B>]
|
|
[<B>-build_chain</B>]
|
|
[<B>-x509_strict</B>]
|
|
[<B>-reconnect</B>]
|
|
[<B>-showcerts</B>]
|
|
[<B>-debug</B>]
|
|
[<B>-msg</B>]
|
|
[<B>-nbio_test</B>]
|
|
[<B>-state</B>]
|
|
[<B>-nbio</B>]
|
|
[<B>-crlf</B>]
|
|
[<B>-ign_eof</B>]
|
|
[<B>-no_ign_eof</B>]
|
|
[<B>-psk_identity identity</B>]
|
|
[<B>-psk key</B>]
|
|
[<B>-psk_session file</B>]
|
|
[<B>-quiet</B>]
|
|
[<B>-ssl3</B>]
|
|
[<B>-tls1</B>]
|
|
[<B>-tls1_1</B>]
|
|
[<B>-tls1_2</B>]
|
|
[<B>-tls1_3</B>]
|
|
[<B>-no_ssl3</B>]
|
|
[<B>-no_tls1</B>]
|
|
[<B>-no_tls1_1</B>]
|
|
[<B>-no_tls1_2</B>]
|
|
[<B>-no_tls1_3</B>]
|
|
[<B>-dtls</B>]
|
|
[<B>-dtls1</B>]
|
|
[<B>-dtls1_2</B>]
|
|
[<B>-sctp</B>]
|
|
[<B>-sctp_label_bug</B>]
|
|
[<B>-fallback_scsv</B>]
|
|
[<B>-async</B>]
|
|
[<B>-max_send_frag</B>]
|
|
[<B>-split_send_frag</B>]
|
|
[<B>-max_pipelines</B>]
|
|
[<B>-read_buf</B>]
|
|
[<B>-bugs</B>]
|
|
[<B>-comp</B>]
|
|
[<B>-no_comp</B>]
|
|
[<B>-allow_no_dhe_kex</B>]
|
|
[<B>-sigalgs sigalglist</B>]
|
|
[<B>-curves curvelist</B>]
|
|
[<B>-cipher cipherlist</B>]
|
|
[<B>-ciphersuites val</B>]
|
|
[<B>-serverpref</B>]
|
|
[<B>-starttls protocol</B>]
|
|
[<B>-xmpphost hostname</B>]
|
|
[<B>-name hostname</B>]
|
|
[<B>-engine id</B>]
|
|
[<B>-tlsextdebug</B>]
|
|
[<B>-no_ticket</B>]
|
|
[<B>-sess_out filename</B>]
|
|
[<B>-sess_in filename</B>]
|
|
[<B>-rand file...</B>]
|
|
[<B>-writerand file</B>]
|
|
[<B>-serverinfo types</B>]
|
|
[<B>-status</B>]
|
|
[<B>-alpn protocols</B>]
|
|
[<B>-nextprotoneg protocols</B>]
|
|
[<B>-ct</B>]
|
|
[<B>-noct</B>]
|
|
[<B>-ctlogfile</B>]
|
|
[<B>-keylogfile file</B>]
|
|
[<B>-early_data file</B>]
|
|
[<B>-enable_pha</B>]
|
|
[<B>target</B>]
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
The <B>s_client</B> command implements a generic <FONT SIZE="-1">SSL/TLS</FONT> client which connects
|
|
to a remote host using <FONT SIZE="-1">SSL/TLS.</FONT> It is a <I>very</I> useful diagnostic tool for
|
|
<FONT SIZE="-1">SSL</FONT> servers.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>OPTIONS</H2>
|
|
|
|
|
|
|
|
In addition to the options below the <B>s_client</B> utility also supports the
|
|
common and client only options documented
|
|
in the ``Supported Command Line Commands'' section of the <B><A HREF="/cgi-bin/man/man2html?3+SSL_CONF_cmd">SSL_CONF_cmd</A></B>(3)
|
|
manual page.
|
|
<DL COMPACT>
|
|
<DT id="1"><B>-help</B><DD>
|
|
|
|
|
|
Print out a usage message.
|
|
<DT id="2"><B>-connect host:port</B><DD>
|
|
|
|
|
|
This specifies the host and optional port to connect to. It is possible to
|
|
select the host and port using the optional target positional argument instead.
|
|
If neither this nor the target positional argument are specified then an attempt
|
|
is made to connect to the local host on port 4433.
|
|
<DT id="3"><B>-bind host:port</B>]<DD>
|
|
|
|
|
|
This specifies the host address and or port to bind as the source for the
|
|
connection. For Unix-domain sockets the port is ignored and the host is
|
|
used as the source socket address.
|
|
<DT id="4"><B>-proxy host:port</B><DD>
|
|
|
|
|
|
When used with the <B>-connect</B> flag, the program uses the host and port
|
|
specified with this flag and issues an <FONT SIZE="-1">HTTP CONNECT</FONT> command to connect
|
|
to the desired server.
|
|
<DT id="5"><B>-unix path</B><DD>
|
|
|
|
|
|
Connect over the specified Unix-domain socket.
|
|
<DT id="6"><B>-4</B><DD>
|
|
|
|
|
|
Use IPv4 only.
|
|
<DT id="7"><B>-6</B><DD>
|
|
|
|
|
|
Use IPv6 only.
|
|
<DT id="8"><B>-servername name</B><DD>
|
|
|
|
|
|
Set the <FONT SIZE="-1">TLS SNI</FONT> (Server Name Indication) extension in the ClientHello message to
|
|
the given value.
|
|
If <B>-servername</B> is not provided, the <FONT SIZE="-1">TLS SNI</FONT> extension will be populated with
|
|
the name given to <B>-connect</B> if it follows a <FONT SIZE="-1">DNS</FONT> name format. If <B>-connect</B> is
|
|
not provided either, the <FONT SIZE="-1">SNI</FONT> is set to ``localhost''.
|
|
This is the default since OpenSSL 1.1.1.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Even though <FONT SIZE="-1">SNI</FONT> should normally be a <FONT SIZE="-1">DNS</FONT> name and not an <FONT SIZE="-1">IP</FONT> address, if
|
|
<B>-servername</B> is provided then that name will be sent, regardless of whether
|
|
it is a <FONT SIZE="-1">DNS</FONT> name or not.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option cannot be used in conjunction with <B>-noservername</B>.
|
|
<DT id="9"><B>-noservername</B><DD>
|
|
|
|
|
|
Suppresses sending of the <FONT SIZE="-1">SNI</FONT> (Server Name Indication) extension in the
|
|
ClientHello message. Cannot be used in conjunction with the <B>-servername</B> or
|
|
<-dane_tlsa_domain> options.
|
|
<DT id="10"><B>-cert certname</B><DD>
|
|
|
|
|
|
The certificate to use, if one is requested by the server. The default is
|
|
not to use a certificate.
|
|
<DT id="11"><B>-certform format</B><DD>
|
|
|
|
|
|
The certificate format to use: <FONT SIZE="-1">DER</FONT> or <FONT SIZE="-1">PEM. PEM</FONT> is the default.
|
|
<DT id="12"><B>-key keyfile</B><DD>
|
|
|
|
|
|
The private key to use. If not specified then the certificate file will
|
|
be used.
|
|
<DT id="13"><B>-keyform format</B><DD>
|
|
|
|
|
|
The private format to use: <FONT SIZE="-1">DER</FONT> or <FONT SIZE="-1">PEM. PEM</FONT> is the default.
|
|
<DT id="14"><B>-cert_chain</B><DD>
|
|
|
|
|
|
A file containing trusted certificates to use when attempting to build the
|
|
client/server certificate chain related to the certificate specified via the
|
|
<B>-cert</B> option.
|
|
<DT id="15"><B>-build_chain</B><DD>
|
|
|
|
|
|
Specify whether the application should build the certificate chain to be
|
|
provided to the server.
|
|
<DT id="16"><B>-xkey infile</B>, <B>-xcert infile</B>, <B>-xchain</B><DD>
|
|
|
|
|
|
Specify an extra certificate, private key and certificate chain. These behave
|
|
in the same manner as the <B>-cert</B>, <B>-key</B> and <B>-cert_chain</B> options. When
|
|
specified, the callback returning the first valid chain will be in use by the
|
|
client.
|
|
<DT id="17"><B>-xchain_build</B><DD>
|
|
|
|
|
|
Specify whether the application should build the certificate chain to be
|
|
provided to the server for the extra certificates provided via <B>-xkey infile</B>,
|
|
<B>-xcert infile</B>, <B>-xchain</B> options.
|
|
<DT id="18"><B>-xcertform PEM|DER</B>, <B>-xkeyform PEM|DER</B><DD>
|
|
|
|
|
|
Extra certificate and private key format respectively.
|
|
<DT id="19"><B>-pass arg</B><DD>
|
|
|
|
|
|
the private key password source. For more information about the format of <B>arg</B>
|
|
see the <B></B><FONT SIZE="-1"><B>PASS PHRASE ARGUMENTS</B></FONT><B></B> section in <B><A HREF="/cgi-bin/man/man2html?1+openssl">openssl</A></B>(1).
|
|
<DT id="20"><B>-verify depth</B><DD>
|
|
|
|
|
|
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.
|
|
<DT id="21"><B>-verify_return_error</B><DD>
|
|
|
|
|
|
Return verification errors instead of continuing. This will typically
|
|
abort the handshake with a fatal error.
|
|
<DT id="22"><B>-nameopt option</B><DD>
|
|
|
|
|
|
Option which determines how the subject or issuer names are displayed. The
|
|
<B>option</B> argument can be a single option or multiple options separated by
|
|
commas. Alternatively the <B>-nameopt</B> switch may be used more than once to
|
|
set multiple options. See the <B><A HREF="/cgi-bin/man/man2html?1+x509">x509</A></B>(1) manual page for details.
|
|
<DT id="23"><B>-CApath directory</B><DD>
|
|
|
|
|
|
The directory to use for server certificate verification. This directory
|
|
must be in ``hash format'', see <B><A HREF="/cgi-bin/man/man2html?1+verify">verify</A></B>(1) for more information. These are
|
|
also used when building the client certificate chain.
|
|
<DT id="24"><B>-CAfile file</B><DD>
|
|
|
|
|
|
A file containing trusted certificates to use during server authentication
|
|
and to use when attempting to build the client certificate chain.
|
|
<DT id="25"><B>-chainCApath directory</B><DD>
|
|
|
|
|
|
The directory to use for building the chain provided to the server. This
|
|
directory must be in ``hash format'', see <B><A HREF="/cgi-bin/man/man2html?1+verify">verify</A></B>(1) for more information.
|
|
<DT id="26"><B>-chainCAfile file</B><DD>
|
|
|
|
|
|
A file containing trusted certificates to use when attempting to build the
|
|
client certificate chain.
|
|
<DT id="27"><B>-no-CAfile</B><DD>
|
|
|
|
|
|
Do not load the trusted <FONT SIZE="-1">CA</FONT> certificates from the default file location
|
|
<DT id="28"><B>-no-CApath</B><DD>
|
|
|
|
|
|
Do not load the trusted <FONT SIZE="-1">CA</FONT> certificates from the default directory location
|
|
<DT id="29"><B>-requestCAfile file</B><DD>
|
|
|
|
|
|
A file containing a list of certificates whose subject names will be sent
|
|
to the server in the <B>certificate_authorities</B> extension. Only supported
|
|
for <FONT SIZE="-1">TLS 1.3</FONT>
|
|
<DT id="30"><B>-dane_tlsa_domain domain</B><DD>
|
|
|
|
|
|
Enable <FONT SIZE="-1">RFC6698/RFC7671 DANE TLSA</FONT> authentication and specify the
|
|
<FONT SIZE="-1">TLSA</FONT> base domain which becomes the default <FONT SIZE="-1">SNI</FONT> 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</B>
|
|
option below.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
When <FONT SIZE="-1">DANE</FONT> authentication succeeds, the diagnostic output will include
|
|
the lowest (closest to 0) depth at which a <FONT SIZE="-1">TLSA</FONT> record authenticated
|
|
a chain certificate. When that <FONT SIZE="-1">TLSA</FONT> 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 ``<FONT SIZE="-1">TA</FONT> public key
|
|
verified''. Otherwise, either the <FONT SIZE="-1">TLSA</FONT> record ``matched <FONT SIZE="-1">TA</FONT> certificate''
|
|
at a positive depth or else ``matched <FONT SIZE="-1">EE</FONT> certificate'' at depth 0.
|
|
<DT id="31"><B>-dane_tlsa_rrdata rrdata</B><DD>
|
|
|
|
|
|
Use one or more times to specify the <FONT SIZE="-1">RRDATA</FONT> fields of the <FONT SIZE="-1">DANE TLSA</FONT>
|
|
RRset associated with the target service. The <B>rrdata</B> value is
|
|
specified 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:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
$ openssl 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
|
|
...
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="32"><B>-dane_ee_no_namechecks</B><DD>
|
|
|
|
|
|
This disables server name checks when authenticating via <FONT SIZE="-1"><B><A HREF="/cgi-bin/man/man2html?3+DANE-EE">DANE-EE</A></B></FONT><B></B>(3) <FONT SIZE="-1">TLSA</FONT>
|
|
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 <FONT SIZE="-1">RFC7671,</FONT> name checks are by default enabled for
|
|
<FONT SIZE="-1"><B><A HREF="/cgi-bin/man/man2html?3+DANE-EE">DANE-EE</A></B></FONT><B></B>(3) <FONT SIZE="-1">TLSA</FONT> records, and can be disabled in applications where it is safe
|
|
to do so.
|
|
In particular, <FONT SIZE="-1">SMTP</FONT> and <FONT SIZE="-1">XMPP</FONT> clients should set this option as <FONT SIZE="-1">SRV</FONT> and <FONT SIZE="-1">MX</FONT>
|
|
records already make it possible for a remote domain to redirect client
|
|
connections to any server of its choice, and in any case <FONT SIZE="-1">SMTP</FONT> and <FONT SIZE="-1">XMPP</FONT> clients
|
|
do not execute scripts downloaded from remote servers.
|
|
<DT id="33"><B>-attime</B>, <B>-check_ss_sig</B>, <B>-crl_check</B>, <B>-crl_check_all</B>, <B>-explicit_policy</B>, <B>-extended_crl</B>, <B>-ignore_critical</B>, <B>-inhibit_any</B>, <B>-inhibit_map</B>, <B>-no_alt_chains</B>, <B>-no_check_time</B>, <B>-partial_chain</B>, <B>-policy</B>, <B>-policy_check</B>, <B>-policy_print</B>, <B>-purpose</B>, <B>-suiteB_128</B>, <B>-suiteB_128_only</B>, <B>-suiteB_192</B>, <B>-trusted_first</B>, <B>-use_deltas</B>, <B>-auth_level</B>, <B>-verify_depth</B>, <B>-verify_email</B>, <B>-verify_hostname</B>, <B>-verify_ip</B>, <B>-verify_name</B>, <B>-x509_strict</B><DD>
|
|
|
|
|
|
Set various certificate chain validation options. See the
|
|
<B><A HREF="/cgi-bin/man/man2html?1+verify">verify</A></B>(1) manual page for details.
|
|
<DT id="34"><B>-reconnect</B><DD>
|
|
|
|
|
|
Reconnects to the same server 5 times using the same session <FONT SIZE="-1">ID,</FONT> this can
|
|
be used as a test that session caching is working.
|
|
<DT id="35"><B>-showcerts</B><DD>
|
|
|
|
|
|
Displays the server certificate list as sent by the server: it only consists of
|
|
certificates the server has sent (in the order the server has sent them). It is
|
|
<B>not</B> a verified chain.
|
|
<DT id="36"><B>-prexit</B><DD>
|
|
|
|
|
|
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 <FONT SIZE="-1">URL.</FONT> Note: the output produced by this
|
|
option is not always accurate because a connection might never have been
|
|
established.
|
|
<DT id="37"><B>-state</B><DD>
|
|
|
|
|
|
Prints out the <FONT SIZE="-1">SSL</FONT> session states.
|
|
<DT id="38"><B>-debug</B><DD>
|
|
|
|
|
|
Print extensive debugging information including a hex dump of all traffic.
|
|
<DT id="39"><B>-msg</B><DD>
|
|
|
|
|
|
Show all protocol messages with hex dump.
|
|
<DT id="40"><B>-trace</B><DD>
|
|
|
|
|
|
Show verbose trace output of protocol messages. OpenSSL needs to be compiled
|
|
with <B>enable-ssl-trace</B> for this option to work.
|
|
<DT id="41"><B>-msgfile</B><DD>
|
|
|
|
|
|
File to send output of <B>-msg</B> or <B>-trace</B> to, default standard output.
|
|
<DT id="42"><B>-nbio_test</B><DD>
|
|
|
|
|
|
Tests non-blocking I/O
|
|
<DT id="43"><B>-nbio</B><DD>
|
|
|
|
|
|
Turns on non-blocking I/O
|
|
<DT id="44"><B>-crlf</B><DD>
|
|
|
|
|
|
This option translated a line feed from the terminal into <FONT SIZE="-1">CR+LF</FONT> as required
|
|
by some servers.
|
|
<DT id="45"><B>-ign_eof</B><DD>
|
|
|
|
|
|
Inhibit shutting down the connection when end of file is reached in the
|
|
input.
|
|
<DT id="46"><B>-quiet</B><DD>
|
|
|
|
|
|
Inhibit printing of session and certificate information. This implicitly
|
|
turns on <B>-ign_eof</B> as well.
|
|
<DT id="47"><B>-no_ign_eof</B><DD>
|
|
|
|
|
|
Shut down the connection when end of file is reached in the input.
|
|
Can be used to override the implicit <B>-ign_eof</B> after <B>-quiet</B>.
|
|
<DT id="48"><B>-psk_identity identity</B><DD>
|
|
|
|
|
|
Use the <FONT SIZE="-1">PSK</FONT> identity <B>identity</B> when using a <FONT SIZE="-1">PSK</FONT> cipher suite.
|
|
The default value is ``Client_identity'' (without the quotes).
|
|
<DT id="49"><B>-psk key</B><DD>
|
|
|
|
|
|
Use the <FONT SIZE="-1">PSK</FONT> key <B>key</B> when using a <FONT SIZE="-1">PSK</FONT> cipher suite. The key is
|
|
given as a hexadecimal number without leading 0x, for example -psk
|
|
1a2b3c4d.
|
|
This option must be provided in order to use a <FONT SIZE="-1">PSK</FONT> cipher.
|
|
<DT id="50"><B>-psk_session file</B><DD>
|
|
|
|
|
|
Use the pem encoded <FONT SIZE="-1">SSL_SESSION</FONT> data stored in <B>file</B> as the basis of a <FONT SIZE="-1">PSK.</FONT>
|
|
Note that this will only work if TLSv1.3 is negotiated.
|
|
<DT id="51"><B>-ssl3</B>, <B>-tls1</B>, <B>-tls1_1</B>, <B>-tls1_2</B>, <B>-tls1_3</B>, <B>-no_ssl3</B>, <B>-no_tls1</B>, <B>-no_tls1_1</B>, <B>-no_tls1_2</B>, <B>-no_tls1_3</B><DD>
|
|
|
|
|
|
These options require or disable the use of the specified <FONT SIZE="-1">SSL</FONT> or <FONT SIZE="-1">TLS</FONT> protocols.
|
|
By default <B>s_client</B> will negotiate the highest mutually supported protocol
|
|
version.
|
|
When a specific <FONT SIZE="-1">TLS</FONT> version is required, only that version will be offered to
|
|
and accepted from the server.
|
|
Note that not all protocols and flags may be available, depending on how
|
|
OpenSSL was built.
|
|
<DT id="52"><B>-dtls</B>, <B>-dtls1</B>, <B>-dtls1_2</B><DD>
|
|
|
|
|
|
These options make <B>s_client</B> use <FONT SIZE="-1">DTLS</FONT> protocols instead of <FONT SIZE="-1">TLS.</FONT>
|
|
With <B>-dtls</B>, <B>s_client</B> will negotiate any supported <FONT SIZE="-1">DTLS</FONT> protocol version,
|
|
whilst <B>-dtls1</B> and <B>-dtls1_2</B> will only support <FONT SIZE="-1">DTLS1.0</FONT> and <FONT SIZE="-1">DTLS1.2</FONT>
|
|
respectively.
|
|
<DT id="53"><B>-sctp</B><DD>
|
|
|
|
|
|
Use <FONT SIZE="-1">SCTP</FONT> for the transport protocol instead of <FONT SIZE="-1">UDP</FONT> in <FONT SIZE="-1">DTLS.</FONT> Must be used in
|
|
conjunction with <B>-dtls</B>, <B>-dtls1</B> or <B>-dtls1_2</B>. This option is only
|
|
available where OpenSSL has support for <FONT SIZE="-1">SCTP</FONT> enabled.
|
|
<DT id="54"><B>-sctp_label_bug</B><DD>
|
|
|
|
|
|
Use the incorrect behaviour of older OpenSSL implementations when computing
|
|
endpoint-pair shared secrets for <FONT SIZE="-1">DTLS/SCTP.</FONT> This allows communication with
|
|
older broken implementations but breaks interoperability with correct
|
|
implementations. Must be used in conjunction with <B>-sctp</B>. This option is only
|
|
available where OpenSSL has support for <FONT SIZE="-1">SCTP</FONT> enabled.
|
|
<DT id="55"><B>-fallback_scsv</B><DD>
|
|
|
|
|
|
Send <FONT SIZE="-1">TLS_FALLBACK_SCSV</FONT> in the ClientHello.
|
|
<DT id="56"><B>-async</B><DD>
|
|
|
|
|
|
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</B> option. For test purposes the dummy async engine
|
|
(dasync) can be used (if available).
|
|
<DT id="57"><B>-max_send_frag int</B><DD>
|
|
|
|
|
|
The maximum size of data fragment to send.
|
|
See <B><A HREF="/cgi-bin/man/man2html?3+SSL_CTX_set_max_send_fragment">SSL_CTX_set_max_send_fragment</A></B>(3) for further information.
|
|
<DT id="58"><B>-split_send_frag int</B><DD>
|
|
|
|
|
|
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 cipher suite has been negotiated, an engine that supports pipelining
|
|
has been loaded, and max_pipelines is greater than 1. See
|
|
<B><A HREF="/cgi-bin/man/man2html?3+SSL_CTX_set_split_send_fragment">SSL_CTX_set_split_send_fragment</A></B>(3) for further information.
|
|
<DT id="59"><B>-max_pipelines int</B><DD>
|
|
|
|
|
|
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 cipher suite has been negotiated. The default value is 1.
|
|
See <B><A HREF="/cgi-bin/man/man2html?3+SSL_CTX_set_max_pipelines">SSL_CTX_set_max_pipelines</A></B>(3) for further information.
|
|
<DT id="60"><B>-read_buf int</B><DD>
|
|
|
|
|
|
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 <B><A HREF="/cgi-bin/man/man2html?3+SSL_CTX_set_default_read_buffer_len">SSL_CTX_set_default_read_buffer_len</A></B>(3) for
|
|
further information).
|
|
<DT id="61"><B>-bugs</B><DD>
|
|
|
|
|
|
There are several known bugs in <FONT SIZE="-1">SSL</FONT> and <FONT SIZE="-1">TLS</FONT> implementations. Adding this
|
|
option enables various workarounds.
|
|
<DT id="62"><B>-comp</B><DD>
|
|
|
|
|
|
Enables support for <FONT SIZE="-1">SSL/TLS</FONT> compression.
|
|
This option was introduced in OpenSSL 1.1.0.
|
|
<FONT SIZE="-1">TLS</FONT> compression is not recommended and is off by default as of
|
|
OpenSSL 1.1.0.
|
|
<DT id="63"><B>-no_comp</B><DD>
|
|
|
|
|
|
Disables support for <FONT SIZE="-1">SSL/TLS</FONT> compression.
|
|
<FONT SIZE="-1">TLS</FONT> compression is not recommended and is off by default as of
|
|
OpenSSL 1.1.0.
|
|
<DT id="64"><B>-brief</B><DD>
|
|
|
|
|
|
Only provide a brief summary of connection parameters instead of the
|
|
normal verbose output.
|
|
<DT id="65"><B>-sigalgs sigalglist</B><DD>
|
|
|
|
|
|
Specifies the list of signature algorithms that are sent by the client.
|
|
The server selects one entry in the list based on its preferences.
|
|
For example strings, see <B><A HREF="/cgi-bin/man/man2html?3+SSL_CTX_set1_sigalgs">SSL_CTX_set1_sigalgs</A></B>(3)
|
|
<DT id="66"><B>-curves curvelist</B><DD>
|
|
|
|
|
|
Specifies the list of supported curves to be sent by the client. The curve is
|
|
ultimately selected by the server. For a list of all curves, use:
|
|
|
|
|
|
<P>
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
$ openssl ecparam -list_curves
|
|
|
|
</PRE>
|
|
|
|
|
|
<DT id="67"><B>-cipher cipherlist</B><DD>
|
|
|
|
|
|
This allows the TLSv1.2 and below cipher list sent by the client to be modified.
|
|
This list will be combined with any TLSv1.3 ciphersuites that have been
|
|
configured. Although the server determines which ciphersuite is used it should
|
|
take the first supported cipher in the list sent by the client. See the
|
|
<B>ciphers</B> command for more information.
|
|
<DT id="68"><B>-ciphersuites val</B><DD>
|
|
|
|
|
|
This allows the TLSv1.3 ciphersuites sent by the client to be modified. This
|
|
list will be combined with any TLSv1.2 and below ciphersuites that have been
|
|
configured. 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</B> command for more information. The format for this list is a simple
|
|
colon (``:'') separated list of TLSv1.3 ciphersuite names.
|
|
<DT id="69"><B>-starttls protocol</B><DD>
|
|
|
|
|
|
Send the protocol-specific message(s) to switch to <FONT SIZE="-1">TLS</FONT> for communication.
|
|
<B>protocol</B> is a keyword for the intended protocol. Currently, the only
|
|
supported keywords are ``smtp'', ``pop3'', ``imap'', ``ftp'', ``xmpp'', ``xmpp-server'',
|
|
``irc'', ``postgres'', ``mysql'', ``lmtp'', ``nntp'', ``sieve'' and ``ldap''.
|
|
<DT id="70"><B>-xmpphost hostname</B><DD>
|
|
|
|
|
|
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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
This option is an alias of the <B>-name</B> option for ``xmpp'' and ``xmpp-server''.
|
|
<DT id="71"><B>-name hostname</B><DD>
|
|
|
|
|
|
This option is used to specify hostname information for various protocols
|
|
used with <B>-starttls</B> option. Currently only ``xmpp'', ``xmpp-server'',
|
|
``smtp'' and ``lmtp'' can utilize this <B>-name</B> option.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If this option is used with ``-starttls xmpp'' or ``-starttls xmpp-server'',
|
|
if 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.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
If this option is used with ``-starttls lmtp'' or ``-starttls smtp'', it specifies
|
|
the name to use in the ``<FONT SIZE="-1">LMTP LHLO''</FONT> or ``<FONT SIZE="-1">SMTP EHLO''</FONT> message, respectively. If
|
|
this option is not specified, then ``mail.example.com'' will be used.
|
|
<DT id="72"><B>-tlsextdebug</B><DD>
|
|
|
|
|
|
Print out a hex dump of any <FONT SIZE="-1">TLS</FONT> extensions received from the server.
|
|
<DT id="73"><B>-no_ticket</B><DD>
|
|
|
|
|
|
Disable RFC4507bis session ticket support.
|
|
<DT id="74"><B>-sess_out filename</B><DD>
|
|
|
|
|
|
Output <FONT SIZE="-1">SSL</FONT> session to <B>filename</B>.
|
|
<DT id="75"><B>-sess_in sess.pem</B><DD>
|
|
|
|
|
|
Load <FONT SIZE="-1">SSL</FONT> session from <B>filename</B>. The client will attempt to resume a
|
|
connection from this session.
|
|
<DT id="76"><B>-engine id</B><DD>
|
|
|
|
|
|
Specifying an engine (by its unique <B>id</B> string) will cause <B>s_client</B>
|
|
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.
|
|
<DT id="77"><B>-rand file...</B><DD>
|
|
|
|
|
|
A file or files containing random data used to seed the random number
|
|
generator.
|
|
Multiple files can be specified separated by an OS-dependent character.
|
|
The separator is <B>;</B> for MS-Windows, <B>,</B> for OpenVMS, and <B>:</B> for
|
|
all others.
|
|
<DT id="78">[<B>-writerand file</B>]<DD>
|
|
|
|
|
|
Writes random data to the specified <I>file</I> upon exit.
|
|
This can be used with a subsequent <B>-rand</B> flag.
|
|
<DT id="79"><B>-serverinfo types</B><DD>
|
|
|
|
|
|
A list of comma-separated <FONT SIZE="-1">TLS</FONT> Extension Types (numbers between 0 and
|
|
65535). Each type will be sent as an empty ClientHello <FONT SIZE="-1">TLS</FONT> Extension.
|
|
The server's response (if any) will be encoded and displayed as a <FONT SIZE="-1">PEM</FONT>
|
|
file.
|
|
<DT id="80"><B>-status</B><DD>
|
|
|
|
|
|
Sends a certificate status request to the server (<FONT SIZE="-1">OCSP</FONT> stapling). The server
|
|
response (if any) is printed out.
|
|
<DT id="81"><B>-alpn protocols</B>, <B>-nextprotoneg protocols</B><DD>
|
|
|
|
|
|
These flags enable the Enable the Application-Layer Protocol Negotiation
|
|
or Next Protocol Negotiation (<FONT SIZE="-1">NPN</FONT>) extension, respectively. <FONT SIZE="-1">ALPN</FONT> is the
|
|
<FONT SIZE="-1">IETF</FONT> standard and replaces <FONT SIZE="-1">NPN.</FONT>
|
|
The <B>protocols</B> list is a comma-separated list of protocol names that
|
|
the client should advertise support for. The list should contain the most
|
|
desirable protocols first. Protocol names are printable <FONT SIZE="-1">ASCII</FONT> strings,
|
|
for example ``http/1.1'' or ``spdy/3''.
|
|
An empty list of protocols is treated specially and will cause the
|
|
client to advertise support for the <FONT SIZE="-1">TLS</FONT> extension but disconnect just
|
|
after receiving ServerHello with a list of server supported protocols.
|
|
The flag <B>-nextprotoneg</B> cannot be specified if <B>-tls1_3</B> is used.
|
|
<DT id="82"><B>-ct</B>, <B>-noct</B><DD>
|
|
|
|
|
|
Use one of these two options to control whether Certificate Transparency (<FONT SIZE="-1">CT</FONT>)
|
|
is enabled (<B>-ct</B>) or disabled (<B>-noct</B>).
|
|
If <FONT SIZE="-1">CT</FONT> is enabled, signed certificate timestamps (SCTs) will be requested from
|
|
the server and reported at handshake completion.
|
|
|
|
|
|
<P>
|
|
|
|
|
|
Enabling <FONT SIZE="-1">CT</FONT> also enables <FONT SIZE="-1">OCSP</FONT> stapling, as this is one possible delivery method
|
|
for SCTs.
|
|
<DT id="83"><B>-ctlogfile</B><DD>
|
|
|
|
|
|
A file containing a list of known Certificate Transparency logs. See
|
|
<B><A HREF="/cgi-bin/man/man2html?3+SSL_CTX_set_ctlog_list_file">SSL_CTX_set_ctlog_list_file</A></B>(3) for the expected file format.
|
|
<DT id="84"><B>-keylogfile file</B><DD>
|
|
|
|
|
|
Appends <FONT SIZE="-1">TLS</FONT> secrets to the specified keylog file such that external programs
|
|
(like Wireshark) can decrypt <FONT SIZE="-1">TLS</FONT> connections.
|
|
<DT id="85"><B>-early_data file</B><DD>
|
|
|
|
|
|
Reads the contents of the specified file and attempts to send it as early data
|
|
to the server. This will only work with resumed sessions that support early
|
|
data and when the server accepts the early data.
|
|
<DT id="86"><B>-enable_pha</B><DD>
|
|
|
|
|
|
For TLSv1.3 only, send the Post-Handshake Authentication extension. This will
|
|
happen whether or not a certificate has been provided via <B>-cert</B>.
|
|
<DT id="87"><B>[target]</B><DD>
|
|
|
|
|
|
Rather than providing <B>-connect</B>, the target hostname and optional port may
|
|
be provided as a single positional argument after all options. If neither this
|
|
nor <B>-connect</B> are provided, falls back to attempting to connect to localhost
|
|
on port 4433.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>CONNECTED COMMANDS</H2>
|
|
|
|
|
|
|
|
If a connection is established with an <FONT SIZE="-1">SSL</FONT> server then any data received
|
|
from the server is displayed and any key presses will be sent to the
|
|
server. If end of file is reached then the connection will be closed down. When
|
|
used interactively (which means neither <B>-quiet</B> nor <B>-ign_eof</B> have been
|
|
given), then certain commands are also recognized which perform special
|
|
operations. These commands are a letter which must appear at the start of a
|
|
line. They are listed below.
|
|
<DL COMPACT>
|
|
<DT id="88"><B>Q</B><DD>
|
|
|
|
|
|
End the current <FONT SIZE="-1">SSL</FONT> connection and exit.
|
|
<DT id="89"><B>R</B><DD>
|
|
|
|
|
|
Renegotiate the <FONT SIZE="-1">SSL</FONT> session (TLSv1.2 and below only).
|
|
<DT id="90"><B>B</B><DD>
|
|
|
|
|
|
Send a heartbeat message to the server (<FONT SIZE="-1">DTLS</FONT> only)
|
|
<DT id="91"><B>k</B><DD>
|
|
|
|
|
|
Send a key update message to the server (TLSv1.3 only)
|
|
<DT id="92"><B>K</B><DD>
|
|
|
|
|
|
Send a key update message to the server and request one back (TLSv1.3 only)
|
|
</DL>
|
|
<A NAME="lbAG"> </A>
|
|
<H2>NOTES</H2>
|
|
|
|
|
|
|
|
<B>s_client</B> can be used to debug <FONT SIZE="-1">SSL</FONT> servers. To connect to an <FONT SIZE="-1">SSL HTTP</FONT>
|
|
server the command:
|
|
<P>
|
|
|
|
|
|
|
|
<PRE>
|
|
openssl s_client -connect servername:443
|
|
|
|
</PRE>
|
|
|
|
|
|
<P>
|
|
|
|
would typically be used (https uses port 443). If the connection succeeds
|
|
then an <FONT SIZE="-1">HTTP</FONT> command can be given such as ``<FONT SIZE="-1">GET /''</FONT> to retrieve a web page.
|
|
<P>
|
|
|
|
If the handshake fails then there are several possible causes, if it is
|
|
nothing obvious like no client certificate then the <B>-bugs</B>,
|
|
<B>-ssl3</B>, <B>-tls1</B>, <B>-no_ssl3</B>, <B>-no_tls1</B> options can be tried
|
|
in case it is a buggy server. In particular you should play with these
|
|
options <B>before</B> submitting a bug report to an OpenSSL mailing list.
|
|
<P>
|
|
|
|
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 <FONT SIZE="-1">CA</FONT> list'' when it
|
|
requests a certificate. By using <B>s_client</B> the <FONT SIZE="-1">CA</FONT> list can be viewed
|
|
and checked. However some servers only request client authentication
|
|
after a specific <FONT SIZE="-1">URL</FONT> is requested. To obtain the list in this case it
|
|
is necessary to use the <B>-prexit</B> option and send an <FONT SIZE="-1">HTTP</FONT> request
|
|
for an appropriate page.
|
|
<P>
|
|
|
|
If a certificate is specified on the command line using the <B>-cert</B>
|
|
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.
|
|
<P>
|
|
|
|
If there are problems verifying a server certificate then the
|
|
<B>-showcerts</B> option can be used to show all the certificates sent by the
|
|
server.
|
|
<P>
|
|
|
|
The <B>s_client</B> 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</B> do this as it makes them vulnerable to a <FONT SIZE="-1">MITM</FONT>
|
|
attack. This behaviour can be changed by with the <B>-verify_return_error</B>
|
|
option: any verify errors are then returned aborting the handshake.
|
|
<P>
|
|
|
|
The <B>-bind</B> option may be useful if the server or a firewall requires
|
|
connections to come from some particular address and or port.
|
|
<A NAME="lbAH"> </A>
|
|
<H2>BUGS</H2>
|
|
|
|
|
|
|
|
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</B> is rather hard to
|
|
read and not a model of how things should be done.
|
|
A typical <FONT SIZE="-1">SSL</FONT> client program would be much simpler.
|
|
<P>
|
|
|
|
The <B>-prexit</B> option is a bit of a hack. We should really report
|
|
information whenever a session is renegotiated.
|
|
<A NAME="lbAI"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
<B><A HREF="/cgi-bin/man/man2html?3+SSL_CONF_cmd">SSL_CONF_cmd</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?1+sess_id">sess_id</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+s_server">s_server</A></B>(1), <B><A HREF="/cgi-bin/man/man2html?1+ciphers">ciphers</A></B>(1),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+SSL_CTX_set_max_send_fragment">SSL_CTX_set_max_send_fragment</A></B>(3), <B><A HREF="/cgi-bin/man/man2html?3+SSL_CTX_set_split_send_fragment">SSL_CTX_set_split_send_fragment</A></B>(3),
|
|
<B><A HREF="/cgi-bin/man/man2html?3+SSL_CTX_set_max_pipelines">SSL_CTX_set_max_pipelines</A></B>(3)
|
|
<A NAME="lbAJ"> </A>
|
|
<H2>HISTORY</H2>
|
|
|
|
|
|
|
|
The <B>-no_alt_chains</B> option was added in OpenSSL 1.1.0.
|
|
The <B>-name</B> option was added in OpenSSL 1.1.1.
|
|
<A NAME="lbAK"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright 2000-2020 The OpenSSL Project Authors. All Rights Reserved.
|
|
<P>
|
|
|
|
Licensed under the OpenSSL license (the ``License''). You may not use
|
|
this file except in compliance with the License. You can obtain a copy
|
|
in the file <FONT SIZE="-1">LICENSE</FONT> in the source distribution or at
|
|
<<A HREF="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</A>>.
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="93"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="94"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="95"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="96"><A HREF="#lbAE">OPTIONS</A><DD>
|
|
<DT id="97"><A HREF="#lbAF">CONNECTED COMMANDS</A><DD>
|
|
<DT id="98"><A HREF="#lbAG">NOTES</A><DD>
|
|
<DT id="99"><A HREF="#lbAH">BUGS</A><DD>
|
|
<DT id="100"><A HREF="#lbAI">SEE ALSO</A><DD>
|
|
<DT id="101"><A HREF="#lbAJ">HISTORY</A><DD>
|
|
<DT id="102"><A HREF="#lbAK">COPYRIGHT</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:26 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|