]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/usr.bin/openssl/man/s_client.1
Regen manual pages.
[FreeBSD/FreeBSD.git] / secure / usr.bin / openssl / man / s_client.1
1 .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .if !\nF .nr F 0
58 .if \nF>0 \{\
59 .    de IX
60 .    tm Index:\\$1\t\\n%\t"\\$2"
61 ..
62 .    if !\nF==2 \{\
63 .        nr % 0
64 .        nr F 2
65 .    \}
66 .\}
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "S_CLIENT 1"
132 .TH S_CLIENT 1 "2018-09-11" "1.1.1" "OpenSSL"
133 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
134 .\" way too many mistakes in technical documents.
135 .if n .ad l
136 .nh
137 .SH "NAME"
138 openssl\-s_client, s_client \- SSL/TLS client program
139 .SH "SYNOPSIS"
140 .IX Header "SYNOPSIS"
141 \&\fBopenssl\fR \fBs_client\fR
142 [\fB\-help\fR]
143 [\fB\-connect host:port\fR]
144 [\fB\-bind host:port\fR]
145 [\fB\-proxy host:port\fR]
146 [\fB\-unix path\fR]
147 [\fB\-4\fR]
148 [\fB\-6\fR]
149 [\fB\-servername name\fR]
150 [\fB\-noservername\fR]
151 [\fB\-verify depth\fR]
152 [\fB\-verify_return_error\fR]
153 [\fB\-cert filename\fR]
154 [\fB\-certform DER|PEM\fR]
155 [\fB\-key filename\fR]
156 [\fB\-keyform DER|PEM\fR]
157 [\fB\-cert_chain filename\fR]
158 [\fB\-build_chain\fR]
159 [\fB\-xkey\fR]
160 [\fB\-xcert\fR]
161 [\fB\-xchain\fR]
162 [\fB\-xchain_build\fR]
163 [\fB\-xcertform PEM|DER\fR]
164 [\fB\-xkeyform PEM|DER\fR]
165 [\fB\-pass arg\fR]
166 [\fB\-CApath directory\fR]
167 [\fB\-CAfile filename\fR]
168 [\fB\-chainCApath directory\fR]
169 [\fB\-chainCAfile filename\fR]
170 [\fB\-no\-CAfile\fR]
171 [\fB\-no\-CApath\fR]
172 [\fB\-requestCAfile filename\fR]
173 [\fB\-dane_tlsa_domain domain\fR]
174 [\fB\-dane_tlsa_rrdata rrdata\fR]
175 [\fB\-dane_ee_no_namechecks\fR]
176 [\fB\-attime timestamp\fR]
177 [\fB\-check_ss_sig\fR]
178 [\fB\-crl_check\fR]
179 [\fB\-crl_check_all\fR]
180 [\fB\-explicit_policy\fR]
181 [\fB\-extended_crl\fR]
182 [\fB\-ignore_critical\fR]
183 [\fB\-inhibit_any\fR]
184 [\fB\-inhibit_map\fR]
185 [\fB\-no_check_time\fR]
186 [\fB\-partial_chain\fR]
187 [\fB\-policy arg\fR]
188 [\fB\-policy_check\fR]
189 [\fB\-policy_print\fR]
190 [\fB\-purpose purpose\fR]
191 [\fB\-suiteB_128\fR]
192 [\fB\-suiteB_128_only\fR]
193 [\fB\-suiteB_192\fR]
194 [\fB\-trusted_first\fR]
195 [\fB\-no_alt_chains\fR]
196 [\fB\-use_deltas\fR]
197 [\fB\-auth_level num\fR]
198 [\fB\-nameopt option\fR]
199 [\fB\-verify_depth num\fR]
200 [\fB\-verify_email email\fR]
201 [\fB\-verify_hostname hostname\fR]
202 [\fB\-verify_ip ip\fR]
203 [\fB\-verify_name name\fR]
204 [\fB\-build_chain\fR]
205 [\fB\-x509_strict\fR]
206 [\fB\-reconnect\fR]
207 [\fB\-showcerts\fR]
208 [\fB\-debug\fR]
209 [\fB\-msg\fR]
210 [\fB\-nbio_test\fR]
211 [\fB\-state\fR]
212 [\fB\-nbio\fR]
213 [\fB\-crlf\fR]
214 [\fB\-ign_eof\fR]
215 [\fB\-no_ign_eof\fR]
216 [\fB\-psk_identity identity\fR]
217 [\fB\-psk key\fR]
218 [\fB\-psk_session file\fR]
219 [\fB\-quiet\fR]
220 [\fB\-ssl3\fR]
221 [\fB\-tls1\fR]
222 [\fB\-tls1_1\fR]
223 [\fB\-tls1_2\fR]
224 [\fB\-tls1_3\fR]
225 [\fB\-no_ssl3\fR]
226 [\fB\-no_tls1\fR]
227 [\fB\-no_tls1_1\fR]
228 [\fB\-no_tls1_2\fR]
229 [\fB\-no_tls1_3\fR]
230 [\fB\-dtls\fR]
231 [\fB\-dtls1\fR]
232 [\fB\-dtls1_2\fR]
233 [\fB\-sctp\fR]
234 [\fB\-fallback_scsv\fR]
235 [\fB\-async\fR]
236 [\fB\-max_send_frag\fR]
237 [\fB\-split_send_frag\fR]
238 [\fB\-max_pipelines\fR]
239 [\fB\-read_buf\fR]
240 [\fB\-bugs\fR]
241 [\fB\-comp\fR]
242 [\fB\-no_comp\fR]
243 [\fB\-allow_no_dhe_kex\fR]
244 [\fB\-sigalgs sigalglist\fR]
245 [\fB\-curves curvelist\fR]
246 [\fB\-cipher cipherlist\fR]
247 [\fB\-ciphersuites val\fR]
248 [\fB\-serverpref\fR]
249 [\fB\-starttls protocol\fR]
250 [\fB\-xmpphost hostname\fR]
251 [\fB\-name hostname\fR]
252 [\fB\-engine id\fR]
253 [\fB\-tlsextdebug\fR]
254 [\fB\-no_ticket\fR]
255 [\fB\-sess_out filename\fR]
256 [\fB\-sess_in filename\fR]
257 [\fB\-rand file...\fR]
258 [\fB\-writerand file\fR]
259 [\fB\-serverinfo types\fR]
260 [\fB\-status\fR]
261 [\fB\-alpn protocols\fR]
262 [\fB\-nextprotoneg protocols\fR]
263 [\fB\-ct\fR]
264 [\fB\-noct\fR]
265 [\fB\-ctlogfile\fR]
266 [\fB\-keylogfile file\fR]
267 [\fB\-early_data file\fR]
268 [\fB\-enable_pha\fR]
269 [\fBtarget\fR]
270 .SH "DESCRIPTION"
271 .IX Header "DESCRIPTION"
272 The \fBs_client\fR command implements a generic \s-1SSL/TLS\s0 client which connects
273 to a remote host using \s-1SSL/TLS.\s0 It is a \fIvery\fR useful diagnostic tool for
274 \&\s-1SSL\s0 servers.
275 .SH "OPTIONS"
276 .IX Header "OPTIONS"
277 In addition to the options below the \fBs_client\fR utility also supports the
278 common and client only options documented in the
279 in the \*(L"Supported Command Line Commands\*(R" section of the \fISSL_CONF_cmd\fR\|(3)
280 manual page.
281 .IP "\fB\-help\fR" 4
282 .IX Item "-help"
283 Print out a usage message.
284 .IP "\fB\-connect host:port\fR" 4
285 .IX Item "-connect host:port"
286 This specifies the host and optional port to connect to. It is possible to
287 select the host and port using the optional target positional argument instead.
288 If neither this nor the target positional argument are specified then an attempt
289 is made to connect to the local host on port 4433.
290 .IP "\fB\-bind host:port\fR]" 4
291 .IX Item "-bind host:port]"
292 This specifies the host address and or port to bind as the source for the
293 connection.  For Unix-domain sockets the port is ignored and the host is
294 used as the source socket address.
295 .IP "\fB\-proxy host:port\fR" 4
296 .IX Item "-proxy host:port"
297 When used with the \fB\-connect\fR flag, the program uses the host and port
298 specified with this flag and issues an \s-1HTTP CONNECT\s0 command to connect
299 to the desired server.
300 .IP "\fB\-unix path\fR" 4
301 .IX Item "-unix path"
302 Connect over the specified Unix-domain socket.
303 .IP "\fB\-4\fR" 4
304 .IX Item "-4"
305 Use IPv4 only.
306 .IP "\fB\-6\fR" 4
307 .IX Item "-6"
308 Use IPv6 only.
309 .IP "\fB\-servername name\fR" 4
310 .IX Item "-servername name"
311 Set the \s-1TLS SNI\s0 (Server Name Indication) extension in the ClientHello message to
312 the given value. If both this option and the \fB\-noservername\fR are not given, the
313 \&\s-1TLS SNI\s0 extension is still set to the hostname provided to the \fB\-connect\fR option,
314 or \*(L"localhost\*(R" if \fB\-connect\fR has not been supplied. This is default since OpenSSL
315 1.1.1.
316 .Sp
317 Even though \s-1SNI\s0 name should normally be a \s-1DNS\s0 name and not an \s-1IP\s0 address, this
318 option will not make the distinction when parsing \fB\-connect\fR and will send
319 \&\s-1IP\s0 address if one passed.
320 .IP "\fB\-noservername\fR" 4
321 .IX Item "-noservername"
322 Suppresses sending of the \s-1SNI\s0 (Server Name Indication) extension in the
323 ClientHello message. Cannot be used in conjunction with the \fB\-servername\fR or
324 <\-dane_tlsa_domain> options.
325 .IP "\fB\-cert certname\fR" 4
326 .IX Item "-cert certname"
327 The certificate to use, if one is requested by the server. The default is
328 not to use a certificate.
329 .IP "\fB\-certform format\fR" 4
330 .IX Item "-certform format"
331 The certificate format to use: \s-1DER\s0 or \s-1PEM. PEM\s0 is the default.
332 .IP "\fB\-key keyfile\fR" 4
333 .IX Item "-key keyfile"
334 The private key to use. If not specified then the certificate file will
335 be used.
336 .IP "\fB\-keyform format\fR" 4
337 .IX Item "-keyform format"
338 The private format to use: \s-1DER\s0 or \s-1PEM. PEM\s0 is the default.
339 .IP "\fB\-cert_chain\fR" 4
340 .IX Item "-cert_chain"
341 A file containing trusted certificates to use when attempting to build the
342 client/server certificate chain related to the certificate specified via the
343 \&\fB\-cert\fR option.
344 .IP "\fB\-build_chain\fR" 4
345 .IX Item "-build_chain"
346 Specify whether the application should build the certificate chain to be
347 provided to the server.
348 .IP "\fB\-xkey infile\fR, \fB\-xcert infile\fR, \fB\-xchain\fR" 4
349 .IX Item "-xkey infile, -xcert infile, -xchain"
350 Specify an extra certificate, private key and certificate chain. These behave
351 in the same manner as the \fB\-cert\fR, \fB\-key\fR and \fB\-cert_chain\fR options.  When
352 specified, the callback returning the first valid chain will be in use by the
353 client.
354 .IP "\fB\-xchain_build\fR" 4
355 .IX Item "-xchain_build"
356 Specify whether the application should build the certificate chain to be
357 provided to the server for the extra certificates provided via \fB\-xkey infile\fR,
358 \&\fB\-xcert infile\fR, \fB\-xchain\fR options.
359 .IP "\fB\-xcertform PEM|DER\fR, \fB\-xkeyform PEM|DER\fR" 4
360 .IX Item "-xcertform PEM|DER, -xkeyform PEM|DER"
361 Extra certificate and private key format respectively.
362 .IP "\fB\-pass arg\fR" 4
363 .IX Item "-pass arg"
364 the private key password source. For more information about the format of \fBarg\fR
365 see the \fB\s-1PASS PHRASE ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1).
366 .IP "\fB\-verify depth\fR" 4
367 .IX Item "-verify depth"
368 The verify depth to use. This specifies the maximum length of the
369 server certificate chain and turns on server certificate verification.
370 Currently the verify operation continues after errors so all the problems
371 with a certificate chain can be seen. As a side effect the connection
372 will never fail due to a server certificate verify failure.
373 .IP "\fB\-verify_return_error\fR" 4
374 .IX Item "-verify_return_error"
375 Return verification errors instead of continuing. This will typically
376 abort the handshake with a fatal error.
377 .IP "\fB\-nameopt option\fR" 4
378 .IX Item "-nameopt option"
379 Option which determines how the subject or issuer names are displayed. The
380 \&\fBoption\fR argument can be a single option or multiple options separated by
381 commas.  Alternatively the \fB\-nameopt\fR switch may be used more than once to
382 set multiple options. See the \fIx509\fR\|(1) manual page for details.
383 .IP "\fB\-CApath directory\fR" 4
384 .IX Item "-CApath directory"
385 The directory to use for server certificate verification. This directory
386 must be in \*(L"hash format\*(R", see \fIverify\fR\|(1) for more information. These are
387 also used when building the client certificate chain.
388 .IP "\fB\-CAfile file\fR" 4
389 .IX Item "-CAfile file"
390 A file containing trusted certificates to use during server authentication
391 and to use when attempting to build the client certificate chain.
392 .IP "\fB\-chainCApath directory\fR" 4
393 .IX Item "-chainCApath directory"
394 The directory to use for building the chain provided to the server. This
395 directory must be in \*(L"hash format\*(R", see \fIverify\fR\|(1) for more information.
396 .IP "\fB\-chainCAfile file\fR" 4
397 .IX Item "-chainCAfile file"
398 A file containing trusted certificates to use when attempting to build the
399 client certificate chain.
400 .IP "\fB\-no\-CAfile\fR" 4
401 .IX Item "-no-CAfile"
402 Do not load the trusted \s-1CA\s0 certificates from the default file location
403 .IP "\fB\-no\-CApath\fR" 4
404 .IX Item "-no-CApath"
405 Do not load the trusted \s-1CA\s0 certificates from the default directory location
406 .IP "\fB\-requestCAfile file\fR" 4
407 .IX Item "-requestCAfile file"
408 A file containing a list of certificates whose subject names will be sent
409 to the server in the \fBcertificate_authorities\fR extension. Only supported
410 for \s-1TLS 1.3\s0
411 .IP "\fB\-dane_tlsa_domain domain\fR" 4
412 .IX Item "-dane_tlsa_domain domain"
413 Enable \s-1RFC6698/RFC7671 DANE TLSA\s0 authentication and specify the
414 \&\s-1TLSA\s0 base domain which becomes the default \s-1SNI\s0 hint and the primary
415 reference identifier for hostname checks.  This must be used in
416 combination with at least one instance of the \fB\-dane_tlsa_rrdata\fR
417 option below.
418 .Sp
419 When \s-1DANE\s0 authentication succeeds, the diagnostic output will include
420 the lowest (closest to 0) depth at which a \s-1TLSA\s0 record authenticated
421 a chain certificate.  When that \s-1TLSA\s0 record is a \*(L"2 1 0\*(R" trust
422 anchor public key that signed (rather than matched) the top-most
423 certificate of the chain, the result is reported as \*(L"\s-1TA\s0 public key
424 verified\*(R".  Otherwise, either the \s-1TLSA\s0 record \*(L"matched \s-1TA\s0 certificate\*(R"
425 at a positive depth or else \*(L"matched \s-1EE\s0 certificate\*(R" at depth 0.
426 .IP "\fB\-dane_tlsa_rrdata rrdata\fR" 4
427 .IX Item "-dane_tlsa_rrdata rrdata"
428 Use one or more times to specify the \s-1RRDATA\s0 fields of the \s-1DANE TLSA\s0
429 RRset associated with the target service.  The \fBrrdata\fR value is
430 specied in \*(L"presentation form\*(R", that is four whitespace separated
431 fields that specify the usage, selector, matching type and associated
432 data, with the last of these encoded in hexadecimal.  Optional
433 whitespace is ignored in the associated data field.  For example:
434 .Sp
435 .Vb 12
436 \&  $ openssl s_client \-brief \-starttls smtp \e
437 \&    \-connect smtp.example.com:25 \e
438 \&    \-dane_tlsa_domain smtp.example.com \e
439 \&    \-dane_tlsa_rrdata "2 1 1
440 \&      B111DD8A1C2091A89BD4FD60C57F0716CCE50FEEFF8137CDBEE0326E 02CF362B" \e
441 \&    \-dane_tlsa_rrdata "2 1 1
442 \&      60B87575447DCBA2A36B7D11AC09FB24A9DB406FEE12D2CC90180517 616E8A18"
443 \&  ...
444 \&  Verification: OK
445 \&  Verified peername: smtp.example.com
446 \&  DANE TLSA 2 1 1 ...ee12d2cc90180517616e8a18 matched TA certificate at depth 1
447 \&  ...
448 .Ve
449 .IP "\fB\-dane_ee_no_namechecks\fR" 4
450 .IX Item "-dane_ee_no_namechecks"
451 This disables server name checks when authenticating via \s-1\fIDANE\-EE\s0\fR\|(3) \s-1TLSA\s0
452 records.
453 For some applications, primarily web browsers, it is not safe to disable name
454 checks due to \*(L"unknown key share\*(R" attacks, in which a malicious server can
455 convince a client that a connection to a victim server is instead a secure
456 connection to the malicious server.
457 The malicious server may then be able to violate cross-origin scripting
458 restrictions.
459 Thus, despite the text of \s-1RFC7671,\s0 name checks are by default enabled for
460 \&\s-1\fIDANE\-EE\s0\fR\|(3) \s-1TLSA\s0 records, and can be disabled in applications where it is safe
461 to do so.
462 In particular, \s-1SMTP\s0 and \s-1XMPP\s0 clients should set this option as \s-1SRV\s0 and \s-1MX\s0
463 records already make it possible for a remote domain to redirect client
464 connections to any server of its choice, and in any case \s-1SMTP\s0 and \s-1XMPP\s0 clients
465 do not execute scripts downloaded from remote servers.
466 .IP "\fB\-attime\fR, \fB\-check_ss_sig\fR, \fB\-crl_check\fR, \fB\-crl_check_all\fR, \fB\-explicit_policy\fR, \fB\-extended_crl\fR, \fB\-ignore_critical\fR, \fB\-inhibit_any\fR, \fB\-inhibit_map\fR, \fB\-no_alt_chains\fR, \fB\-no_check_time\fR, \fB\-partial_chain\fR, \fB\-policy\fR, \fB\-policy_check\fR, \fB\-policy_print\fR, \fB\-purpose\fR, \fB\-suiteB_128\fR, \fB\-suiteB_128_only\fR, \fB\-suiteB_192\fR, \fB\-trusted_first\fR, \fB\-use_deltas\fR, \fB\-auth_level\fR, \fB\-verify_depth\fR, \fB\-verify_email\fR, \fB\-verify_hostname\fR, \fB\-verify_ip\fR, \fB\-verify_name\fR, \fB\-x509_strict\fR" 4
467 .IX Item "-attime, -check_ss_sig, -crl_check, -crl_check_all, -explicit_policy, -extended_crl, -ignore_critical, -inhibit_any, -inhibit_map, -no_alt_chains, -no_check_time, -partial_chain, -policy, -policy_check, -policy_print, -purpose, -suiteB_128, -suiteB_128_only, -suiteB_192, -trusted_first, -use_deltas, -auth_level, -verify_depth, -verify_email, -verify_hostname, -verify_ip, -verify_name, -x509_strict"
468 Set various certificate chain validation options. See the
469 \&\fIverify\fR\|(1) manual page for details.
470 .IP "\fB\-reconnect\fR" 4
471 .IX Item "-reconnect"
472 Reconnects to the same server 5 times using the same session \s-1ID,\s0 this can
473 be used as a test that session caching is working.
474 .IP "\fB\-showcerts\fR" 4
475 .IX Item "-showcerts"
476 Displays the server certificate list as sent by the server: it only consists of
477 certificates the server has sent (in the order the server has sent them). It is
478 \&\fBnot\fR a verified chain.
479 .IP "\fB\-prexit\fR" 4
480 .IX Item "-prexit"
481 Print session information when the program exits. This will always attempt
482 to print out information even if the connection fails. Normally information
483 will only be printed out once if the connection succeeds. This option is useful
484 because the cipher in use may be renegotiated or the connection may fail
485 because a client certificate is required or is requested only after an
486 attempt is made to access a certain \s-1URL.\s0 Note: the output produced by this
487 option is not always accurate because a connection might never have been
488 established.
489 .IP "\fB\-state\fR" 4
490 .IX Item "-state"
491 Prints out the \s-1SSL\s0 session states.
492 .IP "\fB\-debug\fR" 4
493 .IX Item "-debug"
494 Print extensive debugging information including a hex dump of all traffic.
495 .IP "\fB\-msg\fR" 4
496 .IX Item "-msg"
497 Show all protocol messages with hex dump.
498 .IP "\fB\-trace\fR" 4
499 .IX Item "-trace"
500 Show verbose trace output of protocol messages. OpenSSL needs to be compiled
501 with \fBenable-ssl-trace\fR for this option to work.
502 .IP "\fB\-msgfile\fR" 4
503 .IX Item "-msgfile"
504 File to send output of \fB\-msg\fR or \fB\-trace\fR to, default standard output.
505 .IP "\fB\-nbio_test\fR" 4
506 .IX Item "-nbio_test"
507 Tests non-blocking I/O
508 .IP "\fB\-nbio\fR" 4
509 .IX Item "-nbio"
510 Turns on non-blocking I/O
511 .IP "\fB\-crlf\fR" 4
512 .IX Item "-crlf"
513 This option translated a line feed from the terminal into \s-1CR+LF\s0 as required
514 by some servers.
515 .IP "\fB\-ign_eof\fR" 4
516 .IX Item "-ign_eof"
517 Inhibit shutting down the connection when end of file is reached in the
518 input.
519 .IP "\fB\-quiet\fR" 4
520 .IX Item "-quiet"
521 Inhibit printing of session and certificate information.  This implicitly
522 turns on \fB\-ign_eof\fR as well.
523 .IP "\fB\-no_ign_eof\fR" 4
524 .IX Item "-no_ign_eof"
525 Shut down the connection when end of file is reached in the input.
526 Can be used to override the implicit \fB\-ign_eof\fR after \fB\-quiet\fR.
527 .IP "\fB\-psk_identity identity\fR" 4
528 .IX Item "-psk_identity identity"
529 Use the \s-1PSK\s0 identity \fBidentity\fR when using a \s-1PSK\s0 cipher suite.
530 The default value is \*(L"Client_identity\*(R" (without the quotes).
531 .IP "\fB\-psk key\fR" 4
532 .IX Item "-psk key"
533 Use the \s-1PSK\s0 key \fBkey\fR when using a \s-1PSK\s0 cipher suite. The key is
534 given as a hexadecimal number without leading 0x, for example \-psk
535 1a2b3c4d.
536 This option must be provided in order to use a \s-1PSK\s0 cipher.
537 .IP "\fB\-psk_session file\fR" 4
538 .IX Item "-psk_session file"
539 Use the pem encoded \s-1SSL_SESSION\s0 data stored in \fBfile\fR as the basis of a \s-1PSK.\s0
540 Note that this will only work if TLSv1.3 is negotiated.
541 .IP "\fB\-ssl3\fR, \fB\-tls1\fR, \fB\-tls1_1\fR, \fB\-tls1_2\fR, \fB\-tls1_3\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR, \fB\-no_tls1_1\fR, \fB\-no_tls1_2\fR, \fB\-no_tls1_3\fR" 4
542 .IX Item "-ssl3, -tls1, -tls1_1, -tls1_2, -tls1_3, -no_ssl3, -no_tls1, -no_tls1_1, -no_tls1_2, -no_tls1_3"
543 These options require or disable the use of the specified \s-1SSL\s0 or \s-1TLS\s0 protocols.
544 By default \fBs_client\fR will negotiate the highest mutually supported protocol
545 version.
546 When a specific \s-1TLS\s0 version is required, only that version will be offered to
547 and accepted from the server.
548 Note that not all protocols and flags may be available, depending on how
549 OpenSSL was built.
550 .IP "\fB\-dtls\fR, \fB\-dtls1\fR, \fB\-dtls1_2\fR" 4
551 .IX Item "-dtls, -dtls1, -dtls1_2"
552 These options make \fBs_client\fR use \s-1DTLS\s0 protocols instead of \s-1TLS.\s0
553 With \fB\-dtls\fR, \fBs_client\fR will negotiate any supported \s-1DTLS\s0 protocol version,
554 whilst \fB\-dtls1\fR and \fB\-dtls1_2\fR will only support \s-1DTLS1.0\s0 and \s-1DTLS1.2\s0
555 respectively.
556 .IP "\fB\-sctp\fR" 4
557 .IX Item "-sctp"
558 Use \s-1SCTP\s0 for the transport protocol instead of \s-1UDP\s0 in \s-1DTLS.\s0 Must be used in
559 conjunction with \fB\-dtls\fR, \fB\-dtls1\fR or \fB\-dtls1_2\fR. This option is only
560 available where OpenSSL has support for \s-1SCTP\s0 enabled.
561 .IP "\fB\-fallback_scsv\fR" 4
562 .IX Item "-fallback_scsv"
563 Send \s-1TLS_FALLBACK_SCSV\s0 in the ClientHello.
564 .IP "\fB\-async\fR" 4
565 .IX Item "-async"
566 Switch on asynchronous mode. Cryptographic operations will be performed
567 asynchronously. This will only have an effect if an asynchronous capable engine
568 is also used via the \fB\-engine\fR option. For test purposes the dummy async engine
569 (dasync) can be used (if available).
570 .IP "\fB\-max_send_frag int\fR" 4
571 .IX Item "-max_send_frag int"
572 The maximum size of data fragment to send.
573 See \fISSL_CTX_set_max_send_fragment\fR\|(3) for further information.
574 .IP "\fB\-split_send_frag int\fR" 4
575 .IX Item "-split_send_frag int"
576 The size used to split data for encrypt pipelines. If more data is written in
577 one go than this value then it will be split into multiple pipelines, up to the
578 maximum number of pipelines defined by max_pipelines. This only has an effect if
579 a suitable cipher suite has been negotiated, an engine that supports pipelining
580 has been loaded, and max_pipelines is greater than 1. See
581 \&\fISSL_CTX_set_split_send_fragment\fR\|(3) for further information.
582 .IP "\fB\-max_pipelines int\fR" 4
583 .IX Item "-max_pipelines int"
584 The maximum number of encrypt/decrypt pipelines to be used. This will only have
585 an effect if an engine has been loaded that supports pipelining (e.g. the dasync
586 engine) and a suitable cipher suite has been negotiated. The default value is 1.
587 See \fISSL_CTX_set_max_pipelines\fR\|(3) for further information.
588 .IP "\fB\-read_buf int\fR" 4
589 .IX Item "-read_buf int"
590 The default read buffer size to be used for connections. This will only have an
591 effect if the buffer size is larger than the size that would otherwise be used
592 and pipelining is in use (see \fISSL_CTX_set_default_read_buffer_len\fR\|(3) for
593 further information).
594 .IP "\fB\-bugs\fR" 4
595 .IX Item "-bugs"
596 There are several known bug in \s-1SSL\s0 and \s-1TLS\s0 implementations. Adding this
597 option enables various workarounds.
598 .IP "\fB\-comp\fR" 4
599 .IX Item "-comp"
600 Enables support for \s-1SSL/TLS\s0 compression.
601 This option was introduced in OpenSSL 1.1.0.
602 \&\s-1TLS\s0 compression is not recommended and is off by default as of
603 OpenSSL 1.1.0.
604 .IP "\fB\-no_comp\fR" 4
605 .IX Item "-no_comp"
606 Disables support for \s-1SSL/TLS\s0 compression.
607 \&\s-1TLS\s0 compression is not recommended and is off by default as of
608 OpenSSL 1.1.0.
609 .IP "\fB\-brief\fR" 4
610 .IX Item "-brief"
611 Only provide a brief summary of connection parameters instead of the
612 normal verbose output.
613 .IP "\fB\-sigalgs sigalglist\fR" 4
614 .IX Item "-sigalgs sigalglist"
615 Specifies the list of signature algorithms that are sent by the client.
616 The server selects one entry in the list based on its preferences.
617 For example strings, see \fISSL_CTX_set1_sigalgs\fR\|(3)
618 .IP "\fB\-curves curvelist\fR" 4
619 .IX Item "-curves curvelist"
620 Specifies the list of supported curves to be sent by the client. The curve is
621 ultimately selected by the server. For a list of all curves, use:
622 .Sp
623 .Vb 1
624 \&    $ openssl ecparam \-list_curves
625 .Ve
626 .IP "\fB\-cipher cipherlist\fR" 4
627 .IX Item "-cipher cipherlist"
628 This allows the TLSv1.2 and below cipher list sent by the client to be modified.
629 This list will be combined with any TLSv1.3 ciphersuites that have been
630 configured. Although the server determines which ciphersuite is used it should
631 take the first supported cipher in the list sent by the client. See the
632 \&\fBciphers\fR command for more information.
633 .IP "\fB\-ciphersuites val\fR" 4
634 .IX Item "-ciphersuites val"
635 This allows the TLSv1.3 ciphersuites sent by the client to be modified. This
636 list will be combined with any TLSv1.2 and below ciphersuites that have been
637 configured. Although the server determines which cipher suite is used it should
638 take the first supported cipher in the list sent by the client. See the
639 \&\fBciphers\fR command for more information. The format for this list is a simple
640 colon (\*(L":\*(R") separated list of TLSv1.3 ciphersuite names.
641 .IP "\fB\-starttls protocol\fR" 4
642 .IX Item "-starttls protocol"
643 Send the protocol-specific message(s) to switch to \s-1TLS\s0 for communication.
644 \&\fBprotocol\fR is a keyword for the intended protocol.  Currently, the only
645 supported keywords are \*(L"smtp\*(R", \*(L"pop3\*(R", \*(L"imap\*(R", \*(L"ftp\*(R", \*(L"xmpp\*(R", \*(L"xmpp-server\*(R",
646 \&\*(L"irc\*(R", \*(L"postgres\*(R", \*(L"mysql\*(R", \*(L"lmtp\*(R", \*(L"nntp\*(R", \*(L"sieve\*(R" and \*(L"ldap\*(R".
647 .IP "\fB\-xmpphost hostname\fR" 4
648 .IX Item "-xmpphost hostname"
649 This option, when used with \*(L"\-starttls xmpp\*(R" or \*(L"\-starttls xmpp-server\*(R",
650 specifies the host for the \*(L"to\*(R" attribute of the stream element.
651 If this option is not specified, then the host specified with \*(L"\-connect\*(R"
652 will be used.
653 .Sp
654 This option is an alias of the \fB\-name\fR option for \*(L"xmpp\*(R" and \*(L"xmpp-server\*(R".
655 .IP "\fB\-name hostname\fR" 4
656 .IX Item "-name hostname"
657 This option is used to specify hostname information for various protocols
658 used with \fB\-starttls\fR option. Currently only \*(L"xmpp\*(R", \*(L"xmpp-server\*(R",
659 \&\*(L"smtp\*(R" and \*(L"lmtp\*(R" can utilize this \fB\-name\fR option.
660 .Sp
661 If this option is used with \*(L"\-starttls xmpp\*(R" or \*(L"\-starttls xmpp-server\*(R",
662 if specifies the host for the \*(L"to\*(R" attribute of the stream element. If this
663 option is not specified, then the host specified with \*(L"\-connect\*(R" will be used.
664 .Sp
665 If this option is used with \*(L"\-starttls lmtp\*(R" or \*(L"\-starttls smtp\*(R", it specifies
666 the name to use in the \*(L"\s-1LMTP LHLO\*(R"\s0 or \*(L"\s-1SMTP EHLO\*(R"\s0 message, respectively. If
667 this option is not specified, then \*(L"mail.example.com\*(R" will be used.
668 .IP "\fB\-tlsextdebug\fR" 4
669 .IX Item "-tlsextdebug"
670 Print out a hex dump of any \s-1TLS\s0 extensions received from the server.
671 .IP "\fB\-no_ticket\fR" 4
672 .IX Item "-no_ticket"
673 Disable RFC4507bis session ticket support.
674 .IP "\fB\-sess_out filename\fR" 4
675 .IX Item "-sess_out filename"
676 Output \s-1SSL\s0 session to \fBfilename\fR.
677 .IP "\fB\-sess_in sess.pem\fR" 4
678 .IX Item "-sess_in sess.pem"
679 Load \s-1SSL\s0 session from \fBfilename\fR. The client will attempt to resume a
680 connection from this session.
681 .IP "\fB\-engine id\fR" 4
682 .IX Item "-engine id"
683 Specifying an engine (by its unique \fBid\fR string) will cause \fBs_client\fR
684 to attempt to obtain a functional reference to the specified engine,
685 thus initialising it if needed. The engine will then be set as the default
686 for all available algorithms.
687 .IP "\fB\-rand file...\fR" 4
688 .IX Item "-rand file..."
689 A file or files containing random data used to seed the random number
690 generator.
691 Multiple files can be specified separated by an OS-dependent character.
692 The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
693 all others.
694 .IP "[\fB\-writerand file\fR]" 4
695 .IX Item "[-writerand file]"
696 Writes random data to the specified \fIfile\fR upon exit.
697 This can be used with a subsequent \fB\-rand\fR flag.
698 .IP "\fB\-serverinfo types\fR" 4
699 .IX Item "-serverinfo types"
700 A list of comma-separated \s-1TLS\s0 Extension Types (numbers between 0 and
701 65535).  Each type will be sent as an empty ClientHello \s-1TLS\s0 Extension.
702 The server's response (if any) will be encoded and displayed as a \s-1PEM\s0
703 file.
704 .IP "\fB\-status\fR" 4
705 .IX Item "-status"
706 Sends a certificate status request to the server (\s-1OCSP\s0 stapling). The server
707 response (if any) is printed out.
708 .IP "\fB\-alpn protocols\fR, \fB\-nextprotoneg protocols\fR" 4
709 .IX Item "-alpn protocols, -nextprotoneg protocols"
710 These flags enable the Enable the Application-Layer Protocol Negotiation
711 or Next Protocol Negotiation (\s-1NPN\s0) extension, respectively. \s-1ALPN\s0 is the
712 \&\s-1IETF\s0 standard and replaces \s-1NPN.\s0
713 The \fBprotocols\fR list is a comma-separated list of protocol names that
714 the client should advertise support for. The list should contain the most
715 desirable protocols first.  Protocol names are printable \s-1ASCII\s0 strings,
716 for example \*(L"http/1.1\*(R" or \*(L"spdy/3\*(R".
717 An empty list of protocols is treated specially and will cause the
718 client to advertise support for the \s-1TLS\s0 extension but disconnect just
719 after receiving ServerHello with a list of server supported protocols.
720 The flag \fB\-nextprotoneg\fR cannot be specified if \fB\-tls1_3\fR is used.
721 .IP "\fB\-ct\fR, \fB\-noct\fR" 4
722 .IX Item "-ct, -noct"
723 Use one of these two options to control whether Certificate Transparency (\s-1CT\s0)
724 is enabled (\fB\-ct\fR) or disabled (\fB\-noct\fR).
725 If \s-1CT\s0 is enabled, signed certificate timestamps (SCTs) will be requested from
726 the server and reported at handshake completion.
727 .Sp
728 Enabling \s-1CT\s0 also enables \s-1OCSP\s0 stapling, as this is one possible delivery method
729 for SCTs.
730 .IP "\fB\-ctlogfile\fR" 4
731 .IX Item "-ctlogfile"
732 A file containing a list of known Certificate Transparency logs. See
733 \&\fISSL_CTX_set_ctlog_list_file\fR\|(3) for the expected file format.
734 .IP "\fB\-keylogfile file\fR" 4
735 .IX Item "-keylogfile file"
736 Appends \s-1TLS\s0 secrets to the specified keylog file such that external programs
737 (like Wireshark) can decrypt \s-1TLS\s0 connections.
738 .IP "\fB\-early_data file\fR" 4
739 .IX Item "-early_data file"
740 Reads the contents of the specified file and attempts to send it as early data
741 to the server. This will only work with resumed sessions that support early
742 data and when the server accepts the early data.
743 .IP "\fB\-enable_pha\fR" 4
744 .IX Item "-enable_pha"
745 For TLSv1.3 only, send the Post-Handshake Authentication extension. This will
746 happen whether or not a certificate has been provided via \fB\-cert\fR.
747 .IP "\fB[target]\fR" 4
748 .IX Item "[target]"
749 Rather than providing \fB\-connect\fR, the target hostname and optional port may
750 be provided as a single positional argument after all options. If neither this
751 nor \fB\-connect\fR are provided, falls back to attempting to connect to localhost
752 on port 4433.
753 .SH "CONNECTED COMMANDS"
754 .IX Header "CONNECTED COMMANDS"
755 If a connection is established with an \s-1SSL\s0 server then any data received
756 from the server is displayed and any key presses will be sent to the
757 server. If end of file is reached then the connection will be closed down. When
758 used interactively (which means neither \fB\-quiet\fR nor \fB\-ign_eof\fR have been
759 given), then certain commands are also recognized which perform special
760 operations. These commands are a letter which must appear at the start of a
761 line. They are listed below.
762 .IP "\fBQ\fR" 4
763 .IX Item "Q"
764 End the current \s-1SSL\s0 connection and exit.
765 .IP "\fBR\fR" 4
766 .IX Item "R"
767 Renegotiate the \s-1SSL\s0 session (TLSv1.2 and below only).
768 .IP "\fBB\fR" 4
769 .IX Item "B"
770 Send a heartbeat message to the server (\s-1DTLS\s0 only)
771 .IP "\fBk\fR" 4
772 .IX Item "k"
773 Send a key update message to the server (TLSv1.3 only)
774 .IP "\fBK\fR" 4
775 .IX Item "K"
776 Send a key update message to the server and request one back (TLSv1.3 only)
777 .SH "NOTES"
778 .IX Header "NOTES"
779 \&\fBs_client\fR can be used to debug \s-1SSL\s0 servers. To connect to an \s-1SSL HTTP\s0
780 server the command:
781 .PP
782 .Vb 1
783 \& openssl s_client \-connect servername:443
784 .Ve
785 .PP
786 would typically be used (https uses port 443). If the connection succeeds
787 then an \s-1HTTP\s0 command can be given such as \*(L"\s-1GET /\*(R"\s0 to retrieve a web page.
788 .PP
789 If the handshake fails then there are several possible causes, if it is
790 nothing obvious like no client certificate then the \fB\-bugs\fR,
791 \&\fB\-ssl3\fR, \fB\-tls1\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR options can be tried
792 in case it is a buggy server. In particular you should play with these
793 options \fBbefore\fR submitting a bug report to an OpenSSL mailing list.
794 .PP
795 A frequent problem when attempting to get client certificates working
796 is that a web client complains it has no certificates or gives an empty
797 list to choose from. This is normally because the server is not sending
798 the clients certificate authority in its \*(L"acceptable \s-1CA\s0 list\*(R" when it
799 requests a certificate. By using \fBs_client\fR the \s-1CA\s0 list can be viewed
800 and checked. However some servers only request client authentication
801 after a specific \s-1URL\s0 is requested. To obtain the list in this case it
802 is necessary to use the \fB\-prexit\fR option and send an \s-1HTTP\s0 request
803 for an appropriate page.
804 .PP
805 If a certificate is specified on the command line using the \fB\-cert\fR
806 option it will not be used unless the server specifically requests
807 a client certificate. Therefor merely including a client certificate
808 on the command line is no guarantee that the certificate works.
809 .PP
810 If there are problems verifying a server certificate then the
811 \&\fB\-showcerts\fR option can be used to show all the certificates sent by the
812 server.
813 .PP
814 The \fBs_client\fR utility is a test tool and is designed to continue the
815 handshake after any certificate verification errors. As a result it will
816 accept any certificate chain (trusted or not) sent by the peer. None test
817 applications should \fBnot\fR do this as it makes them vulnerable to a \s-1MITM\s0
818 attack. This behaviour can be changed by with the \fB\-verify_return_error\fR
819 option: any verify errors are then returned aborting the handshake.
820 .PP
821 The \fB\-bind\fR option may be useful if the server or a firewall requires
822 connections to come from some particular address and or port.
823 .SH "BUGS"
824 .IX Header "BUGS"
825 Because this program has a lot of options and also because some of the
826 techniques used are rather old, the C source of \fBs_client\fR is rather hard to
827 read and not a model of how things should be done.
828 A typical \s-1SSL\s0 client program would be much simpler.
829 .PP
830 The \fB\-prexit\fR option is a bit of a hack. We should really report
831 information whenever a session is renegotiated.
832 .SH "SEE ALSO"
833 .IX Header "SEE ALSO"
834 \&\fISSL_CONF_cmd\fR\|(3), \fIsess_id\fR\|(1), \fIs_server\fR\|(1), \fIciphers\fR\|(1),
835 \&\fISSL_CTX_set_max_send_fragment\fR\|(3), \fISSL_CTX_set_split_send_fragment\fR\|(3),
836 \&\fISSL_CTX_set_max_pipelines\fR\|(3)
837 .SH "HISTORY"
838 .IX Header "HISTORY"
839 The \fB\-no_alt_chains\fR option was first added to OpenSSL 1.1.0.
840 The \fB\-name\fR option was added in OpenSSL 1.1.1.
841 .SH "COPYRIGHT"
842 .IX Header "COPYRIGHT"
843 Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
844 .PP
845 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
846 this file except in compliance with the License.  You can obtain a copy
847 in the file \s-1LICENSE\s0 in the source distribution or at
848 <https://www.openssl.org/source/license.html>.