Debian Codegraph @

upstream/debian-trixie/man1/openssl-s_client.1ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "OPENSSL-S_CLIENT 1SSL"
58 .TH OPENSSL-S_CLIENT 1SSL 2026-04-07 3.5.6 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 openssl\-s_client \- SSL/TLS client program
65 .SH SYNOPSIS
66 .IX Header "SYNOPSIS"
67 \&\fBopenssl\fR \fBs_client\fR
68 [\fB\-help\fR]
69 [\fB\-ssl_config\fR \fIsection\fR]
70 [\fB\-connect\fR \fIhost\fR:\fIport\fR]
71 [\fB\-host\fR \fIhostname\fR]
72 [\fB\-port\fR \fIport\fR]
73 [\fB\-bind\fR \fIhost\fR:\fIport\fR]
74 [\fB\-proxy\fR \fIhost\fR:\fIport\fR]
75 [\fB\-proxy_user\fR \fIuserid\fR]
76 [\fB\-proxy_pass\fR \fIarg\fR]
77 [\fB\-unix\fR \fIpath\fR]
78 [\fB\-4\fR]
79 [\fB\-6\fR]
80 [\fB\-quic\fR]
81 [\fB\-servername\fR \fIname\fR]
82 [\fB\-noservername\fR]
83 [\fB\-verify\fR \fIdepth\fR]
84 [\fB\-verify_return_error\fR]
85 [\fB\-verify_quiet\fR]
86 [\fB\-verifyCAfile\fR \fIfilename\fR]
87 [\fB\-verifyCApath\fR \fIdir\fR]
88 [\fB\-verifyCAstore\fR \fIuri\fR]
89 [\fB\-cert\fR \fIfilename\fR]
90 [\fB\-certform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR]
91 [\fB\-cert_chain\fR \fIfilename\fR]
92 [\fB\-build_chain\fR]
93 [\fB\-CRL\fR \fIfilename\fR]
94 [\fB\-CRLform\fR \fBDER\fR|\fBPEM\fR]
95 [\fB\-crl_download\fR]
96 [\fB\-key\fR \fIfilename\fR|\fIuri\fR]
97 [\fB\-keyform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR|\fBENGINE\fR]
98 [\fB\-pass\fR \fIarg\fR]
99 [\fB\-chainCAfile\fR \fIfilename\fR]
100 [\fB\-chainCApath\fR \fIdirectory\fR]
101 [\fB\-chainCAstore\fR \fIuri\fR]
102 [\fB\-requestCAfile\fR \fIfilename\fR]
103 [\fB\-dane_tlsa_domain\fR \fIdomain\fR]
104 [\fB\-dane_tlsa_rrdata\fR \fIrrdata\fR]
105 [\fB\-dane_ee_no_namechecks\fR]
106 [\fB\-reconnect\fR]
107 [\fB\-showcerts\fR]
108 [\fB\-prexit\fR]
109 [\fB\-no\-interactive\fR]
110 [\fB\-debug\fR]
111 [\fB\-trace\fR]
112 [\fB\-nocommands\fR]
113 [\fB\-adv\fR]
114 [\fB\-security_debug\fR]
115 [\fB\-security_debug_verbose\fR]
116 [\fB\-msg\fR]
117 [\fB\-timeout\fR]
118 [\fB\-mtu\fR \fIsize\fR]
119 [\fB\-no_ems\fR]
120 [\fB\-keymatexport\fR \fIlabel\fR]
121 [\fB\-keymatexportlen\fR \fIlen\fR]
122 [\fB\-msgfile\fR \fIfilename\fR]
123 [\fB\-nbio_test\fR]
124 [\fB\-state\fR]
125 [\fB\-nbio\fR]
126 [\fB\-crlf\fR]
127 [\fB\-ign_eof\fR]
128 [\fB\-no_ign_eof\fR]
129 [\fB\-psk_identity\fR \fIidentity\fR]
130 [\fB\-psk\fR \fIkey\fR]
131 [\fB\-psk_session\fR \fIfile\fR]
132 [\fB\-quiet\fR]
133 [\fB\-sctp\fR]
134 [\fB\-sctp_label_bug\fR]
135 [\fB\-fallback_scsv\fR]
136 [\fB\-async\fR]
137 [\fB\-maxfraglen\fR \fIlen\fR]
138 [\fB\-max_send_frag\fR]
139 [\fB\-split_send_frag\fR]
140 [\fB\-max_pipelines\fR]
141 [\fB\-read_buf\fR]
142 [\fB\-ignore_unexpected_eof\fR]
143 [\fB\-no_tx_cert_comp\fR]
144 [\fB\-no_rx_cert_comp\fR]
145 [\fB\-brief\fR]
146 [\fB\-starttls\fR \fIprotocol\fR]
147 [\fB\-xmpphost\fR \fIhostname\fR]
148 [\fB\-name\fR \fIhostname\fR]
149 [\fB\-tlsextdebug\fR]
150 [\fB\-sess_out\fR \fIfilename\fR]
151 [\fB\-sess_in\fR \fIfilename\fR]
152 [\fB\-serverinfo\fR \fItypes\fR]
153 [\fB\-status\fR]
154 [\fB\-alpn\fR \fIprotocols\fR]
155 [\fB\-nextprotoneg\fR \fIprotocols\fR]
156 [\fB\-ct\fR]
157 [\fB\-noct\fR]
158 [\fB\-ctlogfile\fR]
159 [\fB\-keylogfile\fR \fIfile\fR]
160 [\fB\-early_data\fR \fIfile\fR]
161 [\fB\-enable_pha\fR]
162 [\fB\-use_srtp\fR \fIvalue\fR]
163 [\fB\-srpuser\fR \fIvalue\fR]
164 [\fB\-srppass\fR \fIvalue\fR]
165 [\fB\-srp_lateuser\fR]
166 [\fB\-srp_moregroups\fR]
167 [\fB\-srp_strength\fR \fInumber\fR]
168 [\fB\-ktls\fR]
169 [\fB\-tfo\fR]
170 [\fB\-nameopt\fR \fIoption\fR]
171 [\fB\-no_ssl3\fR]
172 [\fB\-no_tls1\fR]
173 [\fB\-no_tls1_1\fR]
174 [\fB\-no_tls1_2\fR]
175 [\fB\-no_tls1_3\fR]
176 [\fB\-ssl3\fR]
177 [\fB\-tls1\fR]
178 [\fB\-tls1_1\fR]
179 [\fB\-tls1_2\fR]
180 [\fB\-tls1_3\fR]
181 [\fB\-dtls\fR]
182 [\fB\-dtls1\fR]
183 [\fB\-dtls1_2\fR]
184 [\fB\-xkey\fR \fIinfile\fR]
185 [\fB\-xcert\fR \fIfile\fR]
186 [\fB\-xchain\fR \fIfile\fR]
187 [\fB\-xchain_build\fR \fIfile\fR]
188 [\fB\-xcertform\fR \fBDER\fR|\fBPEM\fR]>
189 [\fB\-xkeyform\fR \fBDER\fR|\fBPEM\fR]>
190 [\fB\-CAfile\fR \fIfile\fR]
191 [\fB\-no\-CAfile\fR]
192 [\fB\-CApath\fR \fIdir\fR]
193 [\fB\-no\-CApath\fR]
194 [\fB\-CAstore\fR \fIuri\fR]
195 [\fB\-no\-CAstore\fR]
196 [\fB\-bugs\fR]
197 [\fB\-no_comp\fR]
198 [\fB\-comp\fR]
199 [\fB\-no_ticket\fR]
200 [\fB\-serverpref\fR]
201 [\fB\-client_renegotiation\fR]
202 [\fB\-legacy_renegotiation\fR]
203 [\fB\-no_renegotiation\fR]
204 [\fB\-no_resumption_on_reneg\fR]
205 [\fB\-legacy_server_connect\fR]
206 [\fB\-no_legacy_server_connect\fR]
207 [\fB\-no_etm\fR]
208 [\fB\-allow_no_dhe_kex\fR]
209 [\fB\-prefer_no_dhe_kex\fR]
210 [\fB\-prioritize_chacha\fR]
211 [\fB\-strict\fR]
212 [\fB\-sigalgs\fR \fIalgs\fR]
213 [\fB\-client_sigalgs\fR \fIalgs\fR]
214 [\fB\-groups\fR \fIgroups\fR]
215 [\fB\-curves\fR \fIcurves\fR]
216 [\fB\-named_curve\fR \fIcurve\fR]
217 [\fB\-cipher\fR \fIciphers\fR]
218 [\fB\-ciphersuites\fR \fI1.3ciphers\fR]
219 [\fB\-min_protocol\fR \fIminprot\fR]
220 [\fB\-max_protocol\fR \fImaxprot\fR]
221 [\fB\-record_padding\fR \fIpadding\fR]
222 [\fB\-debug_broken_protocol\fR]
223 [\fB\-no_middlebox\fR]
224 [\fB\-rand\fR \fIfiles\fR]
225 [\fB\-writerand\fR \fIfile\fR]
226 [\fB\-provider\fR \fIname\fR]
227 [\fB\-provider\-path\fR \fIpath\fR]
228 [\fB\-provparam\fR \fI[name:]key=value\fR]
229 [\fB\-propquery\fR \fIpropq\fR]
230 [\fB\-engine\fR \fIid\fR]
231 [\fB\-ssl_client_engine\fR \fIid\fR]
232 [\fB\-allow_proxy_certs\fR]
233 [\fB\-attime\fR \fItimestamp\fR]
234 [\fB\-no_check_time\fR]
235 [\fB\-check_ss_sig\fR]
236 [\fB\-crl_check\fR]
237 [\fB\-crl_check_all\fR]
238 [\fB\-explicit_policy\fR]
239 [\fB\-extended_crl\fR]
240 [\fB\-ignore_critical\fR]
241 [\fB\-inhibit_any\fR]
242 [\fB\-inhibit_map\fR]
243 [\fB\-partial_chain\fR]
244 [\fB\-policy\fR \fIarg\fR]
245 [\fB\-policy_check\fR]
246 [\fB\-policy_print\fR]
247 [\fB\-purpose\fR \fIpurpose\fR]
248 [\fB\-suiteB_128\fR]
249 [\fB\-suiteB_128_only\fR]
250 [\fB\-suiteB_192\fR]
251 [\fB\-trusted_first\fR]
252 [\fB\-no_alt_chains\fR]
253 [\fB\-use_deltas\fR]
254 [\fB\-auth_level\fR \fInum\fR]
255 [\fB\-verify_depth\fR \fInum\fR]
256 [\fB\-verify_email\fR \fIemail\fR]
257 [\fB\-verify_hostname\fR \fIhostname\fR]
258 [\fB\-verify_ip\fR \fIip\fR]
259 [\fB\-verify_name\fR \fIname\fR]
260 [\fB\-x509_strict\fR]
261 [\fB\-issuer_checks\fR]
262 [\fB\-enable_server_rpk\fR]
263 [\fB\-enable_client_rpk\fR]
264 [\fIhost\fR:\fIport\fR]
265 .SH DESCRIPTION
266 .IX Header "DESCRIPTION"
267 This command implements a generic SSL/TLS client which
268 connects to a remote host using SSL/TLS. It is a \fIvery\fR useful diagnostic
269 tool for SSL servers.
270 .SH OPTIONS
271 .IX Header "OPTIONS"
272 In addition to the options below, this command also supports the
273 common and client only options documented
274 in the "Supported Command Line Commands" section of the \fBSSL_CONF_cmd\fR\|(3)
275 manual page.
276 .IP \fB\-help\fR 4
277 .IX Item "-help"
278 Print out a usage message.
279 .IP "\fB\-ssl_config\fR \fIsection\fR" 4
280 .IX Item "-ssl_config section"
281 Use the specified section of the configuration file to configure the \fBSSL_CTX\fR object.
282 .IP "\fB\-connect\fR \fIhost\fR:\fIport\fR" 4
283 .IX Item "-connect host:port"
284 This specifies the host and optional port to connect to. It is possible to
285 select the host and port using the optional target positional argument instead.
286 If neither this nor the target positional argument are specified then an attempt
287 is made to connect to the local host on port 4433.
288 If the host string is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
289 .IP "\fB\-host\fR \fIhostname\fR" 4
290 .IX Item "-host hostname"
291 Host to connect to; use \fB\-connect\fR instead.
292 .IP "\fB\-port\fR \fIport\fR" 4
293 .IX Item "-port port"
294 Connect to the specified port; use \fB\-connect\fR instead.
295 .IP "\fB\-bind\fR \fIhost\fR:\fIport\fR" 4
296 .IX Item "-bind host:port"
297 This specifies the host address and or port to bind as the source for the
298 connection. For Unix-domain sockets the port is ignored and the host is
299 used as the source socket address.
300 If the host string is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
301 .IP "\fB\-proxy\fR \fIhost\fR:\fIport\fR" 4
302 .IX Item "-proxy host:port"
303 When used with the \fB\-connect\fR flag, the program uses the host and port
304 specified with this flag and issues an HTTP CONNECT command to connect
305 to the desired server.
306 If the host string is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
307 .IP "\fB\-proxy_user\fR \fIuserid\fR" 4
308 .IX Item "-proxy_user userid"
309 When used with the \fB\-proxy\fR flag, the program will attempt to authenticate
310 with the specified proxy using basic (base64) authentication.
311 NB: Basic authentication is insecure; the credentials are sent to the proxy
312 in easily reversible base64 encoding before any TLS/SSL session is established.
313 Therefore, these credentials are easily recovered by anyone able to sniff/trace
314 the network. Use with caution.
315 .IP "\fB\-proxy_pass\fR \fIarg\fR" 4
316 .IX Item "-proxy_pass arg"
317 The proxy password source, used with the \fB\-proxy_user\fR flag.
318 For more information about the format of \fBarg\fR
319 see \fBopenssl\-passphrase\-options\fR\|(1).
320 .IP "\fB\-unix\fR \fIpath\fR" 4
321 .IX Item "-unix path"
322 Connect over the specified Unix-domain socket.
323 .IP \fB\-4\fR 4
324 .IX Item "-4"
325 Use IPv4 only.
326 .IP \fB\-6\fR 4
327 .IX Item "-6"
328 Use IPv6 only.
329 .IP \fB\-quic\fR 4
330 .IX Item "-quic"
331 Connect using the QUIC protocol. If specified then the \fB\-alpn\fR option must also
332 be provided.
333 .IP "\fB\-servername\fR \fIname\fR" 4
334 .IX Item "-servername name"
335 Set the TLS SNI (Server Name Indication) extension in the ClientHello message to
336 the given value.
337 If \fB\-servername\fR is not provided, the TLS SNI extension will be populated with
338 the name given to \fB\-connect\fR if it follows a DNS name format. If \fB\-connect\fR is
339 not provided either, the SNI is set to "localhost".
340 This is the default since OpenSSL 1.1.1.
341 .Sp
342 Even though SNI should normally be a DNS name and not an IP address, if
343 \&\fB\-servername\fR is provided then that name will be sent, regardless of whether
344 it is a DNS name or not.
345 .Sp
346 This option cannot be used in conjunction with \fB\-noservername\fR.
347 .IP \fB\-noservername\fR 4
348 .IX Item "-noservername"
349 Suppresses sending of the SNI (Server Name Indication) extension in the
350 ClientHello message. Cannot be used in conjunction with the \fB\-servername\fR or
351 \&\fB\-dane_tlsa_domain\fR options.
352 .IP "\fB\-cert\fR \fIfilename\fR" 4
353 .IX Item "-cert filename"
354 The client certificate to use, if one is requested by the server.
355 The default is not to use a certificate.
356 .Sp
357 The chain for the client certificate may be specified using \fB\-cert_chain\fR.
358 .IP "\fB\-certform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR" 4
359 .IX Item "-certform DER|PEM|P12"
360 The client certificate file format to use; unspecified by default.
361 See \fBopenssl\-format\-options\fR\|(1) for details.
362 .IP \fB\-cert_chain\fR 4
363 .IX Item "-cert_chain"
364 A file or URI of untrusted certificates to use when attempting to build the
365 certificate chain related to the certificate specified via the \fB\-cert\fR option.
366 The input can be in PEM, DER, or PKCS#12 format.
367 .IP \fB\-build_chain\fR 4
368 .IX Item "-build_chain"
369 Specify whether the application should build the client certificate chain to be
370 provided to the server.
371 .IP "\fB\-CRL\fR \fIfilename\fR" 4
372 .IX Item "-CRL filename"
373 CRL file to use to check the server's certificate.
374 .IP "\fB\-CRLform\fR \fBDER\fR|\fBPEM\fR" 4
375 .IX Item "-CRLform DER|PEM"
376 The CRL file format; unspecified by default.
377 See \fBopenssl\-format\-options\fR\|(1) for details.
378 .IP \fB\-crl_download\fR 4
379 .IX Item "-crl_download"
380 Download CRL from distribution points in the certificate. Note that this option
381 is ignored if \fB\-crl_check\fR option is not provided. Note that the maximum size
382 of CRL is limited by \fBX509_CRL_load_http\fR\|(3) function.
383 .IP "\fB\-key\fR \fIfilename\fR|\fIuri\fR" 4
384 .IX Item "-key filename|uri"
385 The client private key to use.
386 If not specified then the certificate file will be used to read also the key.
387 .IP "\fB\-keyform\fR \fBDER\fR|\fBPEM\fR|\fBP12\fR|\fBENGINE\fR" 4
388 .IX Item "-keyform DER|PEM|P12|ENGINE"
389 The key format; unspecified by default.
390 See \fBopenssl\-format\-options\fR\|(1) for details.
391 .IP "\fB\-pass\fR \fIarg\fR" 4
392 .IX Item "-pass arg"
393 the private key and certificate file password source.
394 For more information about the format of \fIarg\fR
395 see \fBopenssl\-passphrase\-options\fR\|(1).
396 .IP "\fB\-verify\fR \fIdepth\fR" 4
397 .IX Item "-verify depth"
398 The verify depth to use. This specifies the maximum length of the
399 server certificate chain and turns on server certificate verification.
400 Unless the \fB\-verify_return_error\fR option is given,
401 the verify operation continues after errors so all the problems
402 with a certificate chain can be seen. As a side effect the connection
403 will never fail due to a server certificate verify failure.
404 .Sp
405 By default, validation of server certificates and their chain
406 is done w.r.t. the (D)TLS Server (\f(CW\*(C`sslserver\*(C'\fR) purpose.
407 For details see "Certificate Extensions" in \fBopenssl\-verification\-options\fR\|(1).
408 .IP \fB\-verify_return_error\fR 4
409 .IX Item "-verify_return_error"
410 Turns on server certificate verification, like with \fB\-verify\fR,
411 but returns verification errors instead of continuing.
412 This will typically abort the handshake with a fatal error.
413 .IP \fB\-verify_quiet\fR 4
414 .IX Item "-verify_quiet"
415 Limit verify output to only errors.
416 .IP "\fB\-verifyCAfile\fR \fIfilename\fR" 4
417 .IX Item "-verifyCAfile filename"
418 A file in PEM format containing trusted certificates to use
419 for verifying the server's certificate.
420 .IP "\fB\-verifyCApath\fR \fIdir\fR" 4
421 .IX Item "-verifyCApath dir"
422 A directory containing trusted certificates to use
423 for verifying the server's certificate.
424 This directory must be in "hash format",
425 see \fBopenssl\-verify\fR\|(1) for more information.
426 .IP "\fB\-verifyCAstore\fR \fIuri\fR" 4
427 .IX Item "-verifyCAstore uri"
428 The URI of a store containing trusted certificates to use
429 for verifying the server's certificate.
430 .IP "\fB\-chainCAfile\fR \fIfile\fR" 4
431 .IX Item "-chainCAfile file"
432 A file in PEM format containing trusted certificates to use
433 when attempting to build the client certificate chain.
434 .IP "\fB\-chainCApath\fR \fIdirectory\fR" 4
435 .IX Item "-chainCApath directory"
436 A directory containing trusted certificates to use
437 for building the client certificate chain provided to the server.
438 This directory must be in "hash format",
439 see \fBopenssl\-verify\fR\|(1) for more information.
440 .IP "\fB\-chainCAstore\fR \fIuri\fR" 4
441 .IX Item "-chainCAstore uri"
442 The URI of a store containing trusted certificates to use
443 when attempting to build the client certificate chain.
444 The URI may indicate a single certificate, as well as a collection of them.
445 With URIs in the \f(CW\*(C`file:\*(C'\fR scheme, this acts as \fB\-chainCAfile\fR or
446 \&\fB\-chainCApath\fR, depending on if the URI indicates a directory or a
447 single file.
448 See \fBossl_store\-file\fR\|(7) for more information on the \f(CW\*(C`file:\*(C'\fR scheme.
449 .IP "\fB\-requestCAfile\fR \fIfile\fR" 4
450 .IX Item "-requestCAfile file"
451 A file containing a list of certificates whose subject names will be sent
452 to the server in the \fBcertificate_authorities\fR extension. Only supported
453 for TLS 1.3
454 .IP "\fB\-dane_tlsa_domain\fR \fIdomain\fR" 4
455 .IX Item "-dane_tlsa_domain domain"
456 Enable RFC6698/RFC7671 DANE TLSA authentication and specify the
457 TLSA base domain which becomes the default SNI hint and the primary
458 reference identifier for hostname checks. This must be used in
459 combination with at least one instance of the \fB\-dane_tlsa_rrdata\fR
460 option below.
461 .Sp
462 When DANE authentication succeeds, the diagnostic output will include
463 the lowest (closest to 0) depth at which a TLSA record authenticated
464 a chain certificate. When that TLSA record is a "2 1 0" trust
465 anchor public key that signed (rather than matched) the top-most
466 certificate of the chain, the result is reported as "TA public key
467 verified". Otherwise, either the TLSA record "matched TA certificate"
468 at a positive depth or else "matched EE certificate" at depth 0.
469 .IP "\fB\-dane_tlsa_rrdata\fR \fIrrdata\fR" 4
470 .IX Item "-dane_tlsa_rrdata rrdata"
471 Use one or more times to specify the RRDATA fields of the DANE TLSA
472 RRset associated with the target service. The \fIrrdata\fR value is
473 specified in "presentation form", that is four whitespace separated
474 fields that specify the usage, selector, matching type and associated
475 data, with the last of these encoded in hexadecimal. Optional
476 whitespace is ignored in the associated data field. For example:
477 .Sp
478 .Vb 12
479 \& $ openssl s_client \-brief \-starttls smtp \e
480 \& \-connect smtp.example.com:25 \e
481 \& \-dane_tlsa_domain smtp.example.com \e
482 \& \-dane_tlsa_rrdata "2 1 1
483 \& B111DD8A1C2091A89BD4FD60C57F0716CCE50FEEFF8137CDBEE0326E 02CF362B" \e
484 \& \-dane_tlsa_rrdata "2 1 1
485 \& 60B87575447DCBA2A36B7D11AC09FB24A9DB406FEE12D2CC90180517 616E8A18"
486 \& ...
487 \& Verification: OK
488 \& Verified peername: smtp.example.com
489 \& DANE TLSA 2 1 1 ...ee12d2cc90180517616e8a18 matched TA certificate at depth 1
490 \& ...
491 .Ve
492 .IP \fB\-dane_ee_no_namechecks\fR 4
493 .IX Item "-dane_ee_no_namechecks"
494 This disables server name checks when authenticating via \fBDANE\-EE\fR\|(3) TLSA
495 records.
496 For some applications, primarily web browsers, it is not safe to disable name
497 checks due to "unknown key share" attacks, in which a malicious server can
498 convince a client that a connection to a victim server is instead a secure
499 connection to the malicious server.
500 The malicious server may then be able to violate cross-origin scripting
501 restrictions.
502 Thus, despite the text of RFC7671, name checks are by default enabled for
503 \&\fBDANE\-EE\fR\|(3) TLSA records, and can be disabled in applications where it is safe
504 to do so.
505 In particular, SMTP and XMPP clients should set this option as SRV and MX
506 records already make it possible for a remote domain to redirect client
507 connections to any server of its choice, and in any case SMTP and XMPP clients
508 do not execute scripts downloaded from remote servers.
509 .IP \fB\-reconnect\fR 4
510 .IX Item "-reconnect"
511 Reconnects to the same server 5 times using the same session ID, this can
512 be used as a test that session caching is working.
513 .IP \fB\-showcerts\fR 4
514 .IX Item "-showcerts"
515 Displays the server certificate list as sent by the server: it only consists of
516 certificates the server has sent (in the order the server has sent them). It is
517 \&\fBnot\fR a verified chain.
518 .IP \fB\-prexit\fR 4
519 .IX Item "-prexit"
520 Print session information when the program exits. This will always attempt
521 to print out information even if the connection fails. Normally information
522 will only be printed out once if the connection succeeds. This option is useful
523 because the cipher in use may be renegotiated or the connection may fail
524 because a client certificate is required or is requested only after an
525 attempt is made to access a certain URL. Note: the output produced by this
526 option is not always accurate because a connection might never have been
527 established.
528 .IP \fB\-no\-interactive\fR 4
529 .IX Item "-no-interactive"
530 This flag can be used to run the client in a non-interactive mode.
531 .IP \fB\-state\fR 4
532 .IX Item "-state"
533 Prints out the SSL session states.
534 .IP \fB\-debug\fR 4
535 .IX Item "-debug"
536 Print extensive debugging information including a hex dump of all traffic.
537 .IP \fB\-nocommands\fR 4
538 .IX Item "-nocommands"
539 Do not use interactive command letters.
540 .IP \fB\-adv\fR 4
541 .IX Item "-adv"
542 Use advanced command mode.
543 .IP \fB\-security_debug\fR 4
544 .IX Item "-security_debug"
545 Enable security debug messages.
546 .IP \fB\-security_debug_verbose\fR 4
547 .IX Item "-security_debug_verbose"
548 Output more security debug output.
549 .IP \fB\-msg\fR 4
550 .IX Item "-msg"
551 Show protocol messages.
552 .IP \fB\-timeout\fR 4
553 .IX Item "-timeout"
554 Enable send/receive timeout on DTLS connections.
555 .IP "\fB\-mtu\fR \fIsize\fR" 4
556 .IX Item "-mtu size"
557 Set MTU of the link layer to the specified size.
558 .IP \fB\-no_ems\fR 4
559 .IX Item "-no_ems"
560 Disable Extended master secret negotiation.
561 .IP "\fB\-keymatexport\fR \fIlabel\fR" 4
562 .IX Item "-keymatexport label"
563 Export keying material using the specified label.
564 .IP "\fB\-keymatexportlen\fR \fIlen\fR" 4
565 .IX Item "-keymatexportlen len"
566 Export the specified number of bytes of keying material; default is 20.
567 .Sp
568 Show all protocol messages with hex dump.
569 .IP \fB\-trace\fR 4
570 .IX Item "-trace"
571 Show verbose trace output of protocol messages.
572 .IP "\fB\-msgfile\fR \fIfilename\fR" 4
573 .IX Item "-msgfile filename"
574 File to send output of \fB\-msg\fR or \fB\-trace\fR to, default standard output.
575 .IP \fB\-nbio_test\fR 4
576 .IX Item "-nbio_test"
577 Tests nonblocking I/O
578 .IP \fB\-nbio\fR 4
579 .IX Item "-nbio"
580 Turns on nonblocking I/O
581 .IP \fB\-crlf\fR 4
582 .IX Item "-crlf"
583 This option translated a line feed from the terminal into CR+LF as required
584 by some servers.
585 .IP \fB\-ign_eof\fR 4
586 .IX Item "-ign_eof"
587 Inhibit shutting down the connection when end of file is reached in the
588 input. This implicitly turns on \fB\-nocommands\fR as well.
589 .IP \fB\-quiet\fR 4
590 .IX Item "-quiet"
591 Inhibit printing of session and certificate information. This implicitly
592 turns on \fB\-ign_eof\fR and \fB\-nocommands\fR as well.
593 .IP \fB\-no_ign_eof\fR 4
594 .IX Item "-no_ign_eof"
595 Shut down the connection when end of file is reached in the input.
596 Can be used to override the implicit \fB\-ign_eof\fR after \fB\-quiet\fR.
597 .IP "\fB\-psk_identity\fR \fIidentity\fR" 4
598 .IX Item "-psk_identity identity"
599 Use the PSK identity \fIidentity\fR when using a PSK cipher suite.
600 The default value is "Client_identity" (without the quotes).
601 .IP "\fB\-psk\fR \fIkey\fR" 4
602 .IX Item "-psk key"
603 Use the PSK key \fIkey\fR when using a PSK cipher suite. The key is
604 given as a hexadecimal number without leading 0x, for example \-psk
605 1a2b3c4d.
606 This option must be provided in order to use a PSK cipher.
607 .IP "\fB\-psk_session\fR \fIfile\fR" 4
608 .IX Item "-psk_session file"
609 Use the pem encoded SSL_SESSION data stored in \fIfile\fR as the basis of a PSK.
610 Note that this will only work if TLSv1.3 is negotiated.
611 .IP \fB\-sctp\fR 4
612 .IX Item "-sctp"
613 Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in
614 conjunction with \fB\-dtls\fR, \fB\-dtls1\fR or \fB\-dtls1_2\fR. This option is only
615 available where OpenSSL has support for SCTP enabled.
616 .IP \fB\-sctp_label_bug\fR 4
617 .IX Item "-sctp_label_bug"
618 Use the incorrect behaviour of older OpenSSL implementations when computing
619 endpoint-pair shared secrets for DTLS/SCTP. This allows communication with
620 older broken implementations but breaks interoperability with correct
621 implementations. Must be used in conjunction with \fB\-sctp\fR. This option is only
622 available where OpenSSL has support for SCTP enabled.
623 .IP \fB\-fallback_scsv\fR 4
624 .IX Item "-fallback_scsv"
625 Send TLS_FALLBACK_SCSV in the ClientHello.
626 .IP \fB\-async\fR 4
627 .IX Item "-async"
628 Switch on asynchronous mode. Cryptographic operations will be performed
629 asynchronously. This will only have an effect if an asynchronous capable engine
630 is also used via the \fB\-engine\fR option. For test purposes the dummy async engine
631 (dasync) can be used (if available).
632 .IP "\fB\-maxfraglen\fR \fIlen\fR" 4
633 .IX Item "-maxfraglen len"
634 Enable Maximum Fragment Length Negotiation; allowed values are
635 \&\f(CW512\fR, \f(CW1024\fR, \f(CW2048\fR, and \f(CW4096\fR.
636 .IP "\fB\-max_send_frag\fR \fIint\fR" 4
637 .IX Item "-max_send_frag int"
638 The maximum size of data fragment to send.
639 See \fBSSL_CTX_set_max_send_fragment\fR\|(3) for further information.
640 .IP "\fB\-split_send_frag\fR \fIint\fR" 4
641 .IX Item "-split_send_frag int"
642 The size used to split data for encrypt pipelines. If more data is written in
643 one go than this value then it will be split into multiple pipelines, up to the
644 maximum number of pipelines defined by max_pipelines. This only has an effect if
645 a suitable cipher suite has been negotiated, an engine that supports pipelining
646 has been loaded, and max_pipelines is greater than 1. See
647 \&\fBSSL_CTX_set_split_send_fragment\fR\|(3) for further information.
648 .IP "\fB\-max_pipelines\fR \fIint\fR" 4
649 .IX Item "-max_pipelines int"
650 The maximum number of encrypt/decrypt pipelines to be used. This will only have
651 an effect if an engine has been loaded that supports pipelining (e.g. the dasync
652 engine) and a suitable cipher suite has been negotiated. The default value is 1.
653 See \fBSSL_CTX_set_max_pipelines\fR\|(3) for further information.
654 .IP "\fB\-read_buf\fR \fIint\fR" 4
655 .IX Item "-read_buf int"
656 The default read buffer size to be used for connections. This will only have an
657 effect if the buffer size is larger than the size that would otherwise be used
658 and pipelining is in use (see \fBSSL_CTX_set_default_read_buffer_len\fR\|(3) for
659 further information).
660 .IP \fB\-ignore_unexpected_eof\fR 4
661 .IX Item "-ignore_unexpected_eof"
662 Some TLS implementations do not send the mandatory close_notify alert on
663 shutdown. If the application tries to wait for the close_notify alert but the
664 peer closes the connection without sending it, an error is generated. When this
665 option is enabled the peer does not need to send the close_notify alert and a
666 closed connection will be treated as if the close_notify alert was received.
667 For more information on shutting down a connection, see \fBSSL_shutdown\fR\|(3).
668 .IP \fB\-no_tx_cert_comp\fR 4
669 .IX Item "-no_tx_cert_comp"
670 Disables support for sending TLSv1.3 compressed certificates.
671 .IP \fB\-no_rx_cert_comp\fR 4
672 .IX Item "-no_rx_cert_comp"
673 Disables support for receiving TLSv1.3 compressed certificate.
674 .IP \fB\-brief\fR 4
675 .IX Item "-brief"
676 Only provide a brief summary of connection parameters instead of the
677 normal verbose output.
678 .IP "\fB\-starttls\fR \fIprotocol\fR" 4
679 .IX Item "-starttls protocol"
680 Send the protocol-specific message(s) to switch to TLS for communication.
681 \&\fIprotocol\fR is a keyword for the intended protocol. Currently, the only
682 supported keywords are "smtp", "pop3", "imap", "ftp", "xmpp", "xmpp-server",
683 "irc", "postgres", "mysql", "lmtp", "nntp", "sieve" and "ldap".
684 .IP "\fB\-xmpphost\fR \fIhostname\fR" 4
685 .IX Item "-xmpphost hostname"
686 This option, when used with "\-starttls xmpp" or "\-starttls xmpp-server",
687 specifies the host for the "to" attribute of the stream element.
688 If this option is not specified, then the host specified with "\-connect"
689 will be used.
690 .Sp
691 This option is an alias of the \fB\-name\fR option for "xmpp" and "xmpp-server".
692 .IP "\fB\-name\fR \fIhostname\fR" 4
693 .IX Item "-name hostname"
694 This option is used to specify hostname information for various protocols
695 used with \fB\-starttls\fR option. Currently only "xmpp", "xmpp-server",
696 "smtp" and "lmtp" can utilize this \fB\-name\fR option.
697 .Sp
698 If this option is used with "\-starttls xmpp" or "\-starttls xmpp-server",
699 if specifies the host for the "to" attribute of the stream element. If this
700 option is not specified, then the host specified with "\-connect" will be used.
701 .Sp
702 If this option is used with "\-starttls lmtp" or "\-starttls smtp", it specifies
703 the name to use in the "LMTP LHLO" or "SMTP EHLO" message, respectively. If
704 this option is not specified, then "mail.example.com" will be used.
705 .IP \fB\-tlsextdebug\fR 4
706 .IX Item "-tlsextdebug"
707 Print out a hex dump of any TLS extensions received from the server.
708 .IP "\fB\-sess_out\fR \fIfilename\fR" 4
709 .IX Item "-sess_out filename"
710 Output SSL session to \fIfilename\fR.
711 .IP "\fB\-sess_in\fR \fIfilename\fR" 4
712 .IX Item "-sess_in filename"
713 Load SSL session from \fIfilename\fR. The client will attempt to resume a
714 connection from this session.
715 .IP "\fB\-serverinfo\fR \fItypes\fR" 4
716 .IX Item "-serverinfo types"
717 A list of comma-separated TLS Extension Types (numbers between 0 and
718 65535). Each type will be sent as an empty ClientHello TLS Extension.
719 The server's response (if any) will be encoded and displayed as a PEM
720 file.
721 .IP \fB\-status\fR 4
722 .IX Item "-status"
723 Sends a certificate status request to the server (OCSP stapling). The server
724 response (if any) is printed out.
725 .IP "\fB\-alpn\fR \fIprotocols\fR, \fB\-nextprotoneg\fR \fIprotocols\fR" 4
726 .IX Item "-alpn protocols, -nextprotoneg protocols"
727 These flags enable the Enable the Application-Layer Protocol Negotiation
728 or Next Protocol Negotiation (NPN) extension, respectively. ALPN is the
729 IETF standard and replaces NPN.
730 The \fIprotocols\fR list is a comma-separated list of protocol names that
731 the client should advertise support for. The list should contain the most
732 desirable protocols first. Protocol names are printable ASCII strings,
733 for example "http/1.1" or "spdy/3".
734 An empty list of protocols is treated specially and will cause the
735 client to advertise support for the TLS extension but disconnect just
736 after receiving ServerHello with a list of server supported protocols.
737 The flag \fB\-nextprotoneg\fR cannot be specified if \fB\-tls1_3\fR is used.
738 .IP "\fB\-ct\fR, \fB\-noct\fR" 4
739 .IX Item "-ct, -noct"
740 Use one of these two options to control whether Certificate Transparency (CT)
741 is enabled (\fB\-ct\fR) or disabled (\fB\-noct\fR).
742 If CT is enabled, signed certificate timestamps (SCTs) will be requested from
743 the server and reported at handshake completion.
744 .Sp
745 Enabling CT also enables OCSP stapling, as this is one possible delivery method
746 for SCTs.
747 .IP \fB\-ctlogfile\fR 4
748 .IX Item "-ctlogfile"
749 A file containing a list of known Certificate Transparency logs. See
750 \&\fBSSL_CTX_set_ctlog_list_file\fR\|(3) for the expected file format.
751 .IP "\fB\-keylogfile\fR \fIfile\fR" 4
752 .IX Item "-keylogfile file"
753 Appends TLS secrets to the specified keylog file such that external programs
754 (like Wireshark) can decrypt TLS connections.
755 .IP "\fB\-early_data\fR \fIfile\fR" 4
756 .IX Item "-early_data file"
757 Reads the contents of the specified file and attempts to send it as early data
758 to the server. This will only work with resumed sessions that support early
759 data and when the server accepts the early data.
760 .IP \fB\-enable_pha\fR 4
761 .IX Item "-enable_pha"
762 For TLSv1.3 only, send the Post-Handshake Authentication extension. This will
763 happen whether or not a certificate has been provided via \fB\-cert\fR.
764 .IP "\fB\-use_srtp\fR \fIvalue\fR" 4
765 .IX Item "-use_srtp value"
766 Offer SRTP key management, where \fBvalue\fR is a colon-separated profile list.
767 .IP "\fB\-srpuser\fR \fIvalue\fR" 4
768 .IX Item "-srpuser value"
769 Set the SRP username to the specified value. This option is deprecated.
770 .IP "\fB\-srppass\fR \fIvalue\fR" 4
771 .IX Item "-srppass value"
772 Set the SRP password to the specified value. This option is deprecated.
773 .IP \fB\-srp_lateuser\fR 4
774 .IX Item "-srp_lateuser"
775 SRP username for the second ClientHello message. This option is deprecated.
776 .IP "\fB\-srp_moregroups\fR This option is deprecated." 4
777 .IX Item "-srp_moregroups This option is deprecated."
778 Tolerate other than the known \fBg\fR and \fBN\fR values.
779 .IP "\fB\-srp_strength\fR \fInumber\fR" 4
780 .IX Item "-srp_strength number"
781 Set the minimal acceptable length, in bits, for \fBN\fR. This option is
782 deprecated.
783 .IP \fB\-ktls\fR 4
784 .IX Item "-ktls"
785 Enable Kernel TLS for sending and receiving.
786 This option was introduced in OpenSSL 3.2.0.
787 Kernel TLS is off by default as of OpenSSL 3.2.0.
788 .IP \fB\-tfo\fR 4
789 .IX Item "-tfo"
790 Enable creation of connections via TCP fast open (RFC7413).
791 .IP "\fB\-no_ssl3\fR, \fB\-no_tls1\fR, \fB\-no_tls1_1\fR, \fB\-no_tls1_2\fR, \fB\-no_tls1_3\fR, \fB\-ssl3\fR, \fB\-tls1\fR, \fB\-tls1_1\fR, \fB\-tls1_2\fR, \fB\-tls1_3\fR" 4
792 .IX Item "-no_ssl3, -no_tls1, -no_tls1_1, -no_tls1_2, -no_tls1_3, -ssl3, -tls1, -tls1_1, -tls1_2, -tls1_3"
793 See "TLS Version Options" in \fBopenssl\fR\|(1).
794 .IP "\fB\-dtls\fR, \fB\-dtls1\fR, \fB\-dtls1_2\fR" 4
795 .IX Item "-dtls, -dtls1, -dtls1_2"
796 These specify the use of DTLS instead of TLS.
797 See "TLS Version Options" in \fBopenssl\fR\|(1).
798 .IP "\fB\-nameopt\fR \fIoption\fR" 4
799 .IX Item "-nameopt option"
800 This specifies how the subject or issuer names are displayed.
801 See \fBopenssl\-namedisplay\-options\fR\|(1) for details.
802 .IP "\fB\-xkey\fR \fIinfile\fR, \fB\-xcert\fR \fIfile\fR, \fB\-xchain\fR \fIfile\fR, \fB\-xchain_build\fR \fIfile\fR, \fB\-xcertform\fR \fBDER\fR|\fBPEM\fR, \fB\-xkeyform\fR \fBDER\fR|\fBPEM\fR" 4
803 .IX Item "-xkey infile, -xcert file, -xchain file, -xchain_build file, -xcertform DER|PEM, -xkeyform DER|PEM"
804 Set extended certificate verification options.
805 See "Extended Verification Options" in \fBopenssl\-verification\-options\fR\|(1) for details.
806 .IP "\fB\-CAfile\fR \fIfile\fR, \fB\-no\-CAfile\fR, \fB\-CApath\fR \fIdir\fR, \fB\-no\-CApath\fR, \fB\-CAstore\fR \fIuri\fR, \fB\-no\-CAstore\fR" 4
807 .IX Item "-CAfile file, -no-CAfile, -CApath dir, -no-CApath, -CAstore uri, -no-CAstore"
808 See "Trusted Certificate Options" in \fBopenssl\-verification\-options\fR\|(1) for details.
809 .IP "\fB\-bugs\fR, \fB\-comp\fR, \fB\-no_comp\fR, \fB\-no_ticket\fR, \fB\-serverpref\fR, \fB\-client_renegotiation\fR, \fB\-legacy_renegotiation\fR, \fB\-no_renegotiation\fR, \fB\-no_resumption_on_reneg\fR, \fB\-legacy_server_connect\fR, \fB\-no_legacy_server_connect\fR, \fB\-no_etm\fR \fB\-allow_no_dhe_kex\fR, \fB\-prefer_no_dhe_kex\fR, \fB\-prioritize_chacha\fR, \fB\-strict\fR, \fB\-sigalgs\fR \fIalgs\fR, \fB\-client_sigalgs\fR \fIalgs\fR, \fB\-groups\fR \fIgroups\fR, \fB\-curves\fR \fIcurves\fR, \fB\-named_curve\fR \fIcurve\fR, \fB\-cipher\fR \fIciphers\fR, \fB\-ciphersuites\fR \fI1.3ciphers\fR, \fB\-min_protocol\fR \fIminprot\fR, \fB\-max_protocol\fR \fImaxprot\fR, \fB\-record_padding\fR \fIpadding\fR, \fB\-debug_broken_protocol\fR, \fB\-no_middlebox\fR" 4
810 .IX Item "-bugs, -comp, -no_comp, -no_ticket, -serverpref, -client_renegotiation, -legacy_renegotiation, -no_renegotiation, -no_resumption_on_reneg, -legacy_server_connect, -no_legacy_server_connect, -no_etm -allow_no_dhe_kex, -prefer_no_dhe_kex, -prioritize_chacha, -strict, -sigalgs algs, -client_sigalgs algs, -groups groups, -curves curves, -named_curve curve, -cipher ciphers, -ciphersuites 1.3ciphers, -min_protocol minprot, -max_protocol maxprot, -record_padding padding, -debug_broken_protocol, -no_middlebox"
811 See "SUPPORTED COMMAND LINE COMMANDS" in \fBSSL_CONF_cmd\fR\|(3) for details.
812 .IP "\fB\-rand\fR \fIfiles\fR, \fB\-writerand\fR \fIfile\fR" 4
813 .IX Item "-rand files, -writerand file"
814 See "Random State Options" in \fBopenssl\fR\|(1) for details.
815 .IP "\fB\-provider\fR \fIname\fR" 4
816 .IX Item "-provider name"
817 .PD 0
818 .IP "\fB\-provider\-path\fR \fIpath\fR" 4
819 .IX Item "-provider-path path"
820 .IP "\fB\-provparam\fR \fI[name:]key=value\fR" 4
821 .IX Item "-provparam [name:]key=value"
822 .IP "\fB\-propquery\fR \fIpropq\fR" 4
823 .IX Item "-propquery propq"
824 .PD
825 See "Provider Options" in \fBopenssl\fR\|(1), \fBprovider\fR\|(7), and \fBproperty\fR\|(7).
826 .IP "\fB\-engine\fR \fIid\fR" 4
827 .IX Item "-engine id"
828 See "Engine Options" in \fBopenssl\fR\|(1).
829 This option is deprecated.
830 .IP "\fB\-ssl_client_engine\fR \fIid\fR" 4
831 .IX Item "-ssl_client_engine id"
832 Specify engine to be used for client certificate operations.
833 .IP "\fB\-allow_proxy_certs\fR, \fB\-attime\fR, \fB\-no_check_time\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\-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 \fB\-issuer_checks\fR" 4
834 .IX Item "-allow_proxy_certs, -attime, -no_check_time, -check_ss_sig, -crl_check, -crl_check_all, -explicit_policy, -extended_crl, -ignore_critical, -inhibit_any, -inhibit_map, -no_alt_chains, -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 -issuer_checks"
835 Set various options of certificate chain verification.
836 See "Verification Options" in \fBopenssl\-verification\-options\fR\|(1) for details.
837 .Sp
838 Verification errors are displayed, for debugging, but the command will
839 proceed unless the \fB\-verify_return_error\fR option is used.
840 .IP \fB\-enable_server_rpk\fR 4
841 .IX Item "-enable_server_rpk"
842 Enable support for receiving raw public keys (RFC7250) from the server.
843 Use of X.509 certificates by the server becomes optional, and servers that
844 support raw public keys may elect to use them.
845 Servers that don't support raw public keys or prefer to use X.509
846 certificates can still elect to send X.509 certificates as usual.
847 .IP \fB\-enable_client_rpk\fR 4
848 .IX Item "-enable_client_rpk"
849 Enable support for sending raw public keys (RFC7250) to the server.
850 A raw public key will be sent by the client, if solicited by the server,
851 provided a suitable key and public certificate pair is configured.
852 Some servers may nevertheless not request any client credentials,
853 or may request a certificate.
854 .IP \fIhost\fR:\fIport\fR 4
855 .IX Item "host:port"
856 Rather than providing \fB\-connect\fR, the target host and optional port may
857 be provided as a single positional argument after all options. If neither this
858 nor \fB\-connect\fR are provided, falls back to attempting to connect to
859 \&\fIlocalhost\fR on port \fI4433\fR.
860 If the host string is an IPv6 address, it must be enclosed in \f(CW\*(C`[\*(C'\fR and \f(CW\*(C`]\*(C'\fR.
861 .SH "CONNECTED COMMANDS (BASIC)"
862 .IX Header "CONNECTED COMMANDS (BASIC)"
863 If a connection is established with an SSL/TLS server then any data received
864 from the server is displayed and any key presses will be sent to the
865 server. If end of file is reached then the connection will be closed down.
866 .PP
867 When used interactively (which means neither \fB\-quiet\fR nor \fB\-ign_eof\fR have been
868 given), and neither of \fB\-adv\fR or \fB\-nocommands\fR are given then "Basic" command
869 mode is entered. In this mode certain commands are recognized which perform
870 special operations. These commands are a letter which must appear at the start
871 of a line. All further data after the initial letter on the line is ignored.
872 The commands are listed below.
873 .IP \fBQ\fR 4
874 .IX Item "Q"
875 End the current SSL connection and exit.
876 .IP \fBR\fR 4
877 .IX Item "R"
878 Renegotiate the SSL session (TLSv1.2 and below only).
879 .IP \fBC\fR 4
880 .IX Item "C"
881 Attempt to reconnect to the server using a resumption handshake.
882 .IP \fBk\fR 4
883 .IX Item "k"
884 Send a key update message to the server (TLSv1.3 only)
885 .IP \fBK\fR 4
886 .IX Item "K"
887 Send a key update message to the server and request one back (TLSv1.3 only)
888 .SH "CONNECTED COMMANDS (ADVANCED)"
889 .IX Header "CONNECTED COMMANDS (ADVANCED)"
890 If \fB\-adv\fR has been given then "advanced" command mode is entered. As with basic
891 mode, if a connection is established with an SSL/TLS server then any data
892 received from the server is displayed and any key presses will be sent to the
893 server. If end of file is reached then the connection will be closed down.
894 .PP
895 Special commands can be supplied by enclosing them in braces, e.g. "{help}" or
896 "{quit}". These commands can appear anywhere in the text entered into s_client,
897 but they are not sent to the server. Some commands can take an argument by
898 ending the command name with ":" and then providing the argument, e.g.
899 "{keyup:req}". Some commands are only available when certain protocol versions
900 have been negotiated.
901 .PP
902 If a newline appears at the end of a line entered into s_client then this is
903 also sent to the server. If a command appears on a line on its own with no other
904 text on the same line, then the newline is suppressed and not sent to the
905 server.
906 .PP
907 The following commands are recognised.
908 .IP \fBhelp\fR 4
909 .IX Item "help"
910 Prints out summary help text about the available commands.
911 .IP \fBquit\fR 4
912 .IX Item "quit"
913 Close the connection to the peer
914 .IP \fBreconnect\fR 4
915 .IX Item "reconnect"
916 Reconnect to the peer and attempt a resumption handshake
917 .IP \fBkeyup\fR 4
918 .IX Item "keyup"
919 Send a Key Update message. TLSv1.3 only. This command takes an optional
920 argument. If the argument "req" is supplied then the peer is also requested to
921 update its keys. Otherwise if "noreq" is supplied the peer is not requested
922 to update its keys. The default is "req".
923 .IP \fBreneg\fR 4
924 .IX Item "reneg"
925 Initiate a renegotiation with the server. (D)TLSv1.2 or below only.
926 .IP \fBfin\fR 4
927 .IX Item "fin"
928 Indicate FIN on the current stream. QUIC only. Once FIN has been sent any
929 further text entered for this stream is ignored.
930 .SH NOTES
931 .IX Header "NOTES"
932 This command can be used to debug SSL servers. To connect to an SSL HTTP
933 server the command:
934 .PP
935 .Vb 1
936 \& openssl s_client \-connect servername:443
937 .Ve
938 .PP
939 would typically be used (https uses port 443). If the connection succeeds
940 then an HTTP command can be given such as "GET /" to retrieve a web page.
941 .PP
942 If the handshake fails then there are several possible causes, if it is
943 nothing obvious like no client certificate then the \fB\-bugs\fR,
944 \&\fB\-ssl3\fR, \fB\-tls1\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR options can be tried
945 in case it is a buggy server. In particular you should play with these
946 options \fBbefore\fR submitting a bug report to an OpenSSL mailing list.
947 .PP
948 A frequent problem when attempting to get client certificates working
949 is that a web client complains it has no certificates or gives an empty
950 list to choose from. This is normally because the server is not sending
951 the clients certificate authority in its "acceptable CA list" when it
952 requests a certificate. By using this command, the CA list can be viewed
953 and checked. However, some servers only request client authentication
954 after a specific URL is requested. To obtain the list in this case it
955 is necessary to use the \fB\-prexit\fR option and send an HTTP request
956 for an appropriate page.
957 .PP
958 If a certificate is specified on the command line using the \fB\-cert\fR
959 option it will not be used unless the server specifically requests
960 a client certificate. Therefore, merely including a client certificate
961 on the command line is no guarantee that the certificate works.
962 .PP
963 If there are problems verifying a server certificate then the
964 \&\fB\-showcerts\fR option can be used to show all the certificates sent by the
965 server.
966 .PP
967 This command is a test tool and is designed to continue the
968 handshake after any certificate verification errors. As a result it will
969 accept any certificate chain (trusted or not) sent by the peer. Non-test
970 applications should \fBnot\fR do this as it makes them vulnerable to a MITM
971 attack. This behaviour can be changed by with the \fB\-verify_return_error\fR
972 option: any verify errors are then returned aborting the handshake.
973 .PP
974 The \fB\-bind\fR option may be useful if the server or a firewall requires
975 connections to come from some particular address and or port.
976 .SS "Note on Non-Interactive Use"
977 .IX Subsection "Note on Non-Interactive Use"
978 When \fBs_client\fR is run in a non-interactive environment (e.g., a cron job or
979 a script without a valid \fIstdin\fR), it may close the connection prematurely,
980 especially with TLS 1.3. To prevent this, you can use the \fB\-ign_eof\fR flag,
981 which keeps \fBs_client\fR running even after reaching EOF from \fIstdin\fR.
982 .PP
983 For example:
984 .PP
985 .Vb 3
986 \& openssl s_client \-connect <server address>:443 \-tls1_3
987 \& \-sess_out /path/to/tls_session_params_file
988 \& \-ign_eof </dev/null
989 .Ve
990 .PP
991 However, relying solely on \fB\-ign_eof\fR can lead to issues if the server keeps
992 the connection open, expecting the client to close first. In such cases, the
993 client may hang indefinitely. This behavior is not uncommon, particularly with
994 protocols where the server waits for a graceful disconnect from the client.
995 .PP
996 For example, when connecting to an SMTP server, the session may pause if the
997 server expects a QUIT command before closing:
998 .PP
999 .Vb 8
1000 \& $ openssl s_client \-brief \-ign_eof \-starttls smtp
1001 \& \-connect <server address>:25 </dev/null
1002 \& CONNECTION ESTABLISHED
1003 \& Protocol version: TLSv1.3
1004 \& Ciphersuite: TLS_AES_256_GCM_SHA384
1005 \& ...
1006 \& 250 CHUNKING
1007 \& [long pause]
1008 .Ve
1009 .PP
1010 To avoid such hangs, it's better to use an application-level command to
1011 initiate a clean disconnect. For SMTP, you can send a QUIT command:
1012 .PP
1013 .Vb 2
1014 \& printf \*(AqQUIT\er\en\*(Aq | openssl s_client \-connect <server address>:25
1015 \& \-starttls smtp \-brief \-ign_eof
1016 .Ve
1017 .PP
1018 Similarly, for HTTP/1.1 connections, including a `Connection: close` header
1019 ensures the server closes the connection after responding:
1020 .PP
1021 .Vb 2
1022 \& printf \*(AqGET / HTTP/1.1\er\enHost: <server address>\er\enConnection: close\er\en\er\en\*(Aq
1023 \& | openssl s_client \-connect <server address>:443 \-brief
1024 .Ve
1025 .PP
1026 These approaches help manage the connection closure gracefully and prevent
1027 hangs caused by the server waiting for the client to initiate the disconnect.
1028 .SH BUGS
1029 .IX Header "BUGS"
1030 Because this program has a lot of options and also because some of the
1031 techniques used are rather old, the C source for this command is rather
1032 hard to read and not a model of how things should be done.
1033 A typical SSL client program would be much simpler.
1034 .PP
1035 The \fB\-prexit\fR option is a bit of a hack. We should really report
1036 information whenever a session is renegotiated.
1037 .SH "SEE ALSO"
1038 .IX Header "SEE ALSO"
1039 \&\fBopenssl\fR\|(1),
1040 \&\fBopenssl\-sess_id\fR\|(1),
1041 \&\fBopenssl\-s_server\fR\|(1),
1042 \&\fBopenssl\-ciphers\fR\|(1),
1043 \&\fBSSL_CONF_cmd\fR\|(3),
1044 \&\fBSSL_CTX_set_max_send_fragment\fR\|(3),
1045 \&\fBSSL_CTX_set_split_send_fragment\fR\|(3),
1046 \&\fBSSL_CTX_set_max_pipelines\fR\|(3),
1047 \&\fBossl_store\-file\fR\|(7)
1048 .SH HISTORY
1049 .IX Header "HISTORY"
1050 The \fB\-no_alt_chains\fR option was added in OpenSSL 1.1.0.
1051 The \fB\-name\fR option was added in OpenSSL 1.1.1.
1052 .PP
1053 The \fB\-certform\fR option has become obsolete in OpenSSL 3.0.0 and has no effect.
1054 .PP
1055 The \fB\-engine\fR option was deprecated in OpenSSL 3.0.
1056 .PP
1057 The
1058 \&\fB\-enable_client_rpk\fR,
1059 \&\fB\-enable_server_rpk\fR,
1060 \&\fB\-no_rx_cert_comp\fR,
1061 \&\fB\-no_tx_cert_comp\fR,
1062 and \fB\-tfo\fR
1063 options were added in OpenSSL 3.2.
1064 .SH COPYRIGHT
1065 .IX Header "COPYRIGHT"
1066 Copyright 2000\-2025 The OpenSSL Project Authors. All Rights Reserved.
1067 .PP
1068 Licensed under the Apache License 2.0 (the "License"). You may not use
1069 this file except in compliance with the License. You can obtain a copy
1070 in the file LICENSE in the source distribution or at
1071 <https://www.openssl.org/source/license.html>.