]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man1/openssl-s_server.pod.in
Disabling Encrypt-then-MAC extension in s_client/s_server
[thirdparty/openssl.git] / doc / man1 / openssl-s_server.pod.in
CommitLineData
a2151c5b 1=pod
625c781d 2{- OpenSSL::safe::output_do_not_edit_headers(); -}
9fcb9702 3
a2151c5b
DSH
4=head1 NAME
5
b6b66573 6openssl-s_server - SSL/TLS server program
a2151c5b
DSH
7
8=head1 SYNOPSIS
9
a2bbe594 10B<openssl> B<s_server>
169394d4 11[B<-help>]
e8769719
RS
12[B<-port> I<+int>]
13[B<-accept> I<val>]
14[B<-unix> I<val>]
a22f9c84
E
15[B<-4>]
16[B<-6>]
0bae1960 17[B<-unlink>]
e8769719
RS
18[B<-context> I<val>]
19[B<-verify> I<int>]
20[B<-Verify> I<int>]
21[B<-cert> I<infile>]
2b264aee 22[B<-cert2> I<infile>]
6d382c74 23[B<-certform> B<DER>|B<PEM>|B<P12>]
2b264aee
DDO
24[B<-cert_chain> I<infile>]
25[B<-build_chain>]
26[B<-serverinfo> I<val>]
f91d003a
RL
27[B<-key> I<filename>|I<uri>]
28[B<-key2> I<filename>|I<uri>]
6d382c74 29[B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
e8769719
RS
30[B<-pass> I<val>]
31[B<-dcert> I<infile>]
6d382c74 32[B<-dcertform> B<DER>|B<PEM>|B<P12>]
2b264aee 33[B<-dcert_chain> I<infile>]
f91d003a 34[B<-dkey> I<filename>|I<uri>]
6d382c74 35[B<-dkeyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>]
e8769719 36[B<-dpass> I<val>]
a2151c5b
DSH
37[B<-nbio_test>]
38[B<-crlf>]
39[B<-debug>]
1d8634b1 40[B<-msg>]
e8769719 41[B<-msgfile> I<outfile>]
a2151c5b 42[B<-state>]
0bae1960
MC
43[B<-nocert>]
44[B<-quiet>]
45[B<-no_resume_ephemeral>]
46[B<-www>]
47[B<-WWW>]
8b3efb53 48[B<-http_server_binmode>]
90fc2c26 49[B<-no_ca_names>]
09b90e0e 50[B<-ignore_unexpected_eof>]
0bae1960
MC
51[B<-servername>]
52[B<-servername_fatal>]
0bae1960
MC
53[B<-tlsextdebug>]
54[B<-HTTP>]
e8769719 55[B<-id_prefix> I<val>]
e8769719
RS
56[B<-keymatexport> I<val>]
57[B<-keymatexportlen> I<+int>]
58[B<-CRL> I<infile>]
2b264aee 59[B<-CRLform> B<DER>|B<PEM>]
0bae1960 60[B<-crl_download>]
2b264aee 61[B<-chainCAfile> I<infile>]
e8769719 62[B<-chainCApath> I<dir>]
fd3397fc 63[B<-chainCAstore> I<uri>]
2b264aee
DDO
64[B<-verifyCAfile> I<infile>]
65[B<-verifyCApath> I<dir>]
fd3397fc 66[B<-verifyCAstore> I<uri>]
0bae1960
MC
67[B<-no_cache>]
68[B<-ext_cache>]
0bae1960
MC
69[B<-verify_return_error>]
70[B<-verify_quiet>]
0bae1960
MC
71[B<-ign_eof>]
72[B<-no_ign_eof>]
4832560b 73[B<-no_etm>]
0bae1960
MC
74[B<-status>]
75[B<-status_verbose>]
e8769719 76[B<-status_timeout> I<int>]
80a4ac57
DDO
77[B<-proxy> I<[http[s]://][userinfo@]host[:port][/path]>]
78[B<-no_proxy> I<addresses>]
e8769719
RS
79[B<-status_url> I<val>]
80[B<-status_file> I<infile>]
359efeac 81[B<-ssl_config> I<val>]
0bae1960
MC
82[B<-trace>]
83[B<-security_debug>]
84[B<-security_debug_verbose>]
85[B<-brief>]
86[B<-rev>]
87[B<-async>]
e8769719
RS
88[B<-max_send_frag> I<+int>]
89[B<-split_send_frag> I<+int>]
90[B<-max_pipelines> I<+int>]
2b264aee 91[B<-naccept> I<+int>]
e8769719 92[B<-read_buf> I<+int>]
0bae1960
MC
93[B<-bugs>]
94[B<-no_comp>]
95[B<-comp>]
96[B<-no_ticket>]
97[B<-serverpref>]
98[B<-legacy_renegotiation>]
99[B<-no_renegotiation>]
0bae1960
MC
100[B<-no_resumption_on_reneg>]
101[B<-no_legacy_server_connect>]
4e2bd9cb 102[B<-allow_no_dhe_kex>]
e1c7871d 103[B<-prioritize_chacha>]
0bae1960 104[B<-strict>]
e8769719
RS
105[B<-sigalgs> I<val>]
106[B<-client_sigalgs> I<val>]
107[B<-groups> I<val>]
108[B<-curves> I<val>]
109[B<-named_curve> I<val>]
110[B<-cipher> I<val>]
111[B<-ciphersuites> I<val>]
112[B<-dhparam> I<infile>]
113[B<-record_padding> I<val>]
0bae1960 114[B<-debug_broken_protocol>]
0bae1960 115[B<-nbio>]
e8769719
RS
116[B<-psk_identity> I<val>]
117[B<-psk_hint> I<val>]
118[B<-psk> I<val>]
119[B<-psk_session> I<file>]
120[B<-srpvfile> I<infile>]
121[B<-srpuserseed> I<val>]
0bae1960 122[B<-timeout>]
e8769719 123[B<-mtu> I<+int>]
0bae1960 124[B<-listen>]
19044d3c 125[B<-sctp>]
09d62b33 126[B<-sctp_label_bug>]
359efeac 127[B<-use_srtp> I<val>]
a2151c5b 128[B<-no_dhe>]
e8769719 129[B<-nextprotoneg> I<val>]
e8769719 130[B<-alpn> I<val>]
cd81ac7b 131[B<-sendfile>]
e8769719 132[B<-keylogfile> I<outfile>]
65718c51 133[B<-recv_max_early_data> I<int>]
8b3efb53 134[B<-max_early_data> I<int>]
6437b802 135[B<-early_data>]
65718c51 136[B<-stateless>]
3bb5e5b0
MC
137[B<-anti_replay>]
138[B<-no_anti_replay>]
8b3efb53 139[B<-num_tickets>]
bc24e3ee 140{- $OpenSSL::safe::opt_name_synopsis -}
d4bff20d 141{- $OpenSSL::safe::opt_version_synopsis -}
21d08b9e 142{- $OpenSSL::safe::opt_v_synopsis -}
8b3efb53 143{- $OpenSSL::safe::opt_s_synopsis -}
9fcb9702
RS
144{- $OpenSSL::safe::opt_x_synopsis -}
145{- $OpenSSL::safe::opt_trust_synopsis -}
146{- $OpenSSL::safe::opt_r_synopsis -}
d55e4487 147{- $OpenSSL::safe::opt_engine_synopsis -}{- $OpenSSL::safe::opt_provider_synopsis -}
7efd0e77 148
a2151c5b
DSH
149=head1 DESCRIPTION
150
35a810bb
RL
151This command implements a generic SSL/TLS server which
152listens for connections on a given port using SSL/TLS.
a2151c5b
DSH
153
154=head1 OPTIONS
155
35a810bb
RL
156In addition to the options below, this command also supports
157the common and server only options documented
f5c14c63 158L<SSL_CONF_cmd(3)/Supported Command Line Commands>
765b4137 159
a2151c5b
DSH
160=over 4
161
169394d4
MR
162=item B<-help>
163
164Print out a usage message.
165
e8769719 166=item B<-port> I<+int>
a2151c5b 167
8c73aeb6 168The TCP port to listen on for connections. If not specified 4433 is used.
a2151c5b 169
e8769719 170=item B<-accept> I<val>
a22f9c84
E
171
172The optional TCP host and port to listen on for connections. If not specified, *:4433 is used.
173
e8769719 174=item B<-unix> I<val>
a22f9c84
E
175
176Unix domain socket to accept on.
177
a22f9c84
E
178=item B<-4>
179
180Use IPv4 only.
181
182=item B<-6>
183
184Use IPv6 only.
185
0bae1960
MC
186=item B<-unlink>
187
188For -unix, unlink any existing socket first.
189
e8769719 190=item B<-context> I<val>
a2151c5b 191
8c73aeb6 192Sets the SSL context id. It can be given any string value. If this option
cc8709a0 193is not present a default value will be used.
a2151c5b 194
e8769719 195=item B<-verify> I<int>, B<-Verify> I<int>
0bae1960
MC
196
197The verify depth to use. This specifies the maximum length of the
198client certificate chain and makes the server request a certificate from
199the client. With the B<-verify> option a certificate is requested but the
200client does not have to send one, with the B<-Verify> option the client
201must supply a certificate or an error occurs.
202
203If the cipher suite cannot request a client certificate (for example an
204anonymous cipher suite or PSK) this option has no effect.
205
e8769719 206=item B<-cert> I<infile>
a2151c5b
DSH
207
208The certificate to use, most servers cipher suites require the use of a
209certificate and some require a certificate with a certain public key type:
210for example the DSS cipher suites require a certificate containing a DSS
1948394d 211(DSA) key. If not specified then the filename F<server.pem> will be used.
a2151c5b 212
f91d003a
RL
213=item B<-cert2> I<infile>
214
215The certificate file to use for servername; default is C<server2.pem>.
216
6d382c74 217=item B<-certform> B<DER>|B<PEM>|B<P12>
2b264aee 218
bee3f389
TM
219The server certificate file format; unspecified by default.
220See L<openssl-format-options(1)> for details.
2b264aee 221
7cacbe9d
DB
222=item B<-cert_chain>
223
b3c5aadf 224A file or URI of untrusted certificates to use when attempting to build the
2b264aee 225certificate chain related to the certificate specified via the B<-cert> option.
b3c5aadf 226The input can be in PEM, DER, or PKCS#12 format.
7cacbe9d
DB
227
228=item B<-build_chain>
229
2b264aee 230Specify whether the application should build the server certificate chain to be
7cacbe9d
DB
231provided to the client.
232
e8769719 233=item B<-serverinfo> I<val>
0bae1960
MC
234
235A file containing one or more blocks of PEM data. Each PEM block
236must encode a TLS ServerHello extension (2 bytes type, 2 bytes length,
237followed by "length" bytes of extension data). If the client sends
238an empty TLS ClientHello extension matching the type, the corresponding
239ServerHello extension will be returned.
240
f91d003a 241=item B<-key> I<filename>|I<uri>
a2151c5b
DSH
242
243The private key to use. If not specified then the certificate file will
244be used.
245
f91d003a
RL
246=item B<-key2> I<filename>|I<uri>
247
248The private Key file to use for servername if not given via B<-cert2>.
249
6d382c74 250=item B<-keyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
826a42a0 251
bee3f389 252The key format; unspecified by default.
46949153 253See L<openssl-format-options(1)> for details.
826a42a0 254
e8769719 255=item B<-pass> I<val>
826a42a0 256
2a33470b 257The private key and certificate file password source.
777182a0 258For more information about the format of I<val>,
46949153 259see L<openssl-passphrase-options(1)>.
826a42a0 260
f91d003a 261=item B<-dcert> I<infile>, B<-dkey> I<filename>|I<uri>
a2151c5b 262
8c73aeb6 263Specify an additional certificate and private key, these behave in the
a2151c5b
DSH
264same manner as the B<-cert> and B<-key> options except there is no default
265if they are not specified (no additional certificate and key is used). As
266noted above some cipher suites require a certificate containing a key of
267a certain type. Some cipher suites need a certificate carrying an RSA key
268and some a DSS (DSA) key. By using RSA and DSS certificates and keys
269a server can support clients which only support RSA or DSS cipher suites
270by using an appropriate certificate.
271
7cacbe9d
DB
272=item B<-dcert_chain>
273
b3c5aadf 274A file or URI of untrusted certificates to use when attempting to build the
7cacbe9d
DB
275server certificate chain when a certificate specified via the B<-dcert> option
276is in use.
b3c5aadf 277The input can be in PEM, DER, or PKCS#12 format.
7cacbe9d 278
6d382c74 279=item B<-dcertform> B<DER>|B<PEM>|B<P12>
2b264aee 280
bee3f389
TM
281The format of the additional certificate file; unspecified by default.
282See L<openssl-format-options(1)> for details.
2b264aee 283
6d382c74 284=item B<-dkeyform> B<DER>|B<PEM>|B<P12>|B<ENGINE>
777182a0 285
bee3f389
TM
286The format of the additional private key; unspecified by default.
287See L<openssl-format-options(1)> for details.
826a42a0 288
777182a0
RS
289=item B<-dpass> I<val>
290
2a33470b 291The passphrase for the additional private key and certificate.
777182a0 292For more information about the format of I<val>,
46949153 293see L<openssl-passphrase-options(1)>.
826a42a0 294
0bae1960 295=item B<-nbio_test>
a2151c5b 296
0bae1960 297Tests non blocking I/O.
a2151c5b 298
0bae1960 299=item B<-crlf>
a2151c5b 300
0bae1960 301This option translated a line feed from the terminal into CR+LF.
a2151c5b 302
0bae1960 303=item B<-debug>
a2151c5b 304
0bae1960 305Print extensive debugging information including a hex dump of all traffic.
a2151c5b 306
359efeac
DDO
307=item B<-security_debug>
308
309Print output from SSL/TLS security framework.
310
311=item B<-security_debug_verbose>
312
313Print more output from SSL/TLS security framework
314
0bae1960 315=item B<-msg>
51e00db2 316
0bae1960 317Show all protocol messages with hex dump.
51e00db2 318
e8769719 319=item B<-msgfile> I<outfile>
a2151c5b 320
0bae1960 321File to send output of B<-msg> or B<-trace> to, default standard output.
a2151c5b 322
0bae1960
MC
323=item B<-state>
324
325Prints the SSL session states.
326
2b264aee
DDO
327=item B<-CRL> I<infile>
328
329The CRL file to use.
330
331=item B<-CRLform> B<DER>|B<PEM>
332
bee3f389 333The CRL file format; unspecified by default.
46949153 334See L<openssl-format-options(1)> for details.
2b264aee
DDO
335
336=item B<-crl_download>
337
338Download CRLs from distribution points given in CDP extensions of certificates
7cacbe9d 339
2b264aee
DDO
340=item B<-verifyCAfile> I<filename>
341
342A file in PEM format CA containing trusted certificates to use
343for verifying client certificates.
344
345=item B<-verifyCApath> I<dir>
346
347A directory containing trusted certificates to use
348for verifying client certificates.
349This directory must be in "hash format",
350see L<openssl-verify(1)> for more information.
351
352=item B<-verifyCAstore> I<uri>
353
354The URI of a store containing trusted certificates to use
355for verifying client certificates.
7cacbe9d 356
e8769719 357=item B<-chainCAfile> I<file>
7cacbe9d 358
2b264aee
DDO
359A file in PEM format containing trusted certificates to use
360when attempting to build the server certificate chain.
361
362=item B<-chainCApath> I<dir>
363
364A directory containing trusted certificates to use
365for building the server certificate chain provided to the client.
366This directory must be in "hash format",
367see L<openssl-verify(1)> for more information.
7cacbe9d 368
fd3397fc
RL
369=item B<-chainCAstore> I<uri>
370
2b264aee
DDO
371The URI of a store containing trusted certificates to use
372for building the server certificate chain provided to the client.
373The URI may indicate a single certificate, as well as a collection of them.
fd3397fc
RL
374With URIs in the C<file:> scheme, this acts as B<-chainCAfile> or
375B<-chainCApath>, depending on if the URI indicates a directory or a
376single file.
377See L<ossl_store-file(7)> for more information on the C<file:> scheme.
378
0bae1960 379=item B<-nocert>
8d419330 380
0bae1960
MC
381If this option is set then no certificate is used. This restricts the
382cipher suites available to the anonymous ones (currently just anonymous
383DH).
8d419330 384
0bae1960 385=item B<-quiet>
a2151c5b 386
0bae1960 387Inhibit printing of session and certificate information.
a2151c5b 388
359efeac
DDO
389=item B<-no_resume_ephemeral>
390
391Disable caching and tickets if ephemeral (EC)DH is used.
392
0b3b2b33
RS
393=item B<-tlsextdebug>
394
395Print a hex dump of any TLS extensions received from the server.
396
0bae1960 397=item B<-www>
a2151c5b 398
0bae1960
MC
399Sends a status message back to the client when it connects. This includes
400information about the ciphers used and various session parameters.
0b3b2b33
RS
401The output is in HTML format so this option can be used with a web browser.
402The special URL C</renegcert> turns on client cert validation, and C</reneg>
403tells the server to request renegotiation.
404The B<-early_data> option cannot be used with this option.
a2151c5b 405
0b3b2b33 406=item B<-WWW>, B<-HTTP>
1d8634b1 407
0bae1960 408Emulates a simple web server. Pages will be resolved relative to the
0b3b2b33
RS
409current directory, for example if the URL C<https://myhost/page.html> is
410requested the file F<./page.html> will be sent.
411If the B<-HTTP> flag is used, the files are sent directly, and should contain
412any HTTP response headers (including status response line).
413If the B<-WWW> option is used,
414the response headers are generated by the server, and the file extension is
415examined to determine the B<Content-Type> header.
416Extensions of C<html>, C<htm>, and C<php> are C<text/html> and all others are
417C<text/plain>.
418In addition, the special URL C</stats> will return status
419information like the B<-www> option.
420Neither of these options can be used in conjunction with B<-early_data>.
8dbeb110 421
8b3efb53
RS
422=item B<-http_server_binmode>
423
424When acting as web-server (using option B<-WWW> or B<-HTTP>) open files requested
425by the client in binary mode.
426
90fc2c26
NM
427=item B<-no_ca_names>
428
429Disable TLS Extension CA Names. You may want to disable it for security reasons
430or for compatibility with some Windows TLS implementations crashing when this
431extension is larger than 1024 bytes.
432
09b90e0e
DB
433=item B<-ignore_unexpected_eof>
434
435Some TLS implementations do not send the mandatory close_notify alert on
436shutdown. If the application tries to wait for the close_notify alert but the
437peer closes the connection without sending it, an error is generated. When this
438option is enabled the peer does not need to send the close_notify alert and a
439closed connection will be treated as if the close_notify alert was received.
440For more information on shutting down a connection, see L<SSL_shutdown(3)>.
441
359efeac
DDO
442=item B<-servername>
443
444Servername for HostName TLS extension.
445
446=item B<-servername_fatal>
447
448On servername mismatch send fatal alert (default: warning alert).
449
e8769719 450=item B<-id_prefix> I<val>
a2151c5b 451
2f0ea936 452Generate SSL/TLS session IDs prefixed by I<val>. This is mostly useful
8c1cbc72 453for testing any SSL/TLS code (e.g. proxies) that wish to deal with multiple
0bae1960 454servers, when each of which might be generating a unique range of session
8c1cbc72 455IDs (e.g. with a certain prefix).
a2151c5b 456
359efeac
DDO
457=item B<-keymatexport>
458
459Export keying material using label.
460
461=item B<-keymatexportlen>
462
463Export the given number of bytes of keying material; default 20.
464
465=item B<-no_cache>
466
467Disable session cache.
468
469=item B<-ext_cache>.
470
471Disable internal cache, set up and use external cache.
472
0bae1960 473=item B<-verify_return_error>
a2151c5b 474
0bae1960
MC
475Verification errors normally just print a message but allow the
476connection to continue, for debugging purposes.
477If this option is used, then verification errors close the connection.
a2151c5b 478
359efeac
DDO
479=item B<-verify_quiet>
480
481No verify output except verify errors.
482
483=item B<-ign_eof>
484
485Ignore input EOF (default: when B<-quiet>).
486
487=item B<-no_ign_eof>
488
489Do not ignore input EOF.
490
4832560b
DB
491=item B<-no_etm>
492
493Disable Encrypt-then-MAC negotiation.
494
0bae1960 495=item B<-status>
a2151c5b 496
0bae1960 497Enables certificate status request support (aka OCSP stapling).
a2151c5b 498
0bae1960 499=item B<-status_verbose>
ddac1974 500
0bae1960
MC
501Enables certificate status request support (aka OCSP stapling) and gives
502a verbose printout of the OCSP response.
ddac1974 503
e8769719 504=item B<-status_timeout> I<int>
720b6cbe 505
2f0ea936 506Sets the timeout for OCSP response to I<int> seconds.
720b6cbe 507
80a4ac57
DDO
508=item B<-proxy> I<[http[s]://][userinfo@]host[:port][/path]>
509
510The HTTP(S) proxy server to use for reaching the OCSP server unless B<-no_proxy>
511applies, see below.
512The proxy port defaults to 80 or 443 if the scheme is C<https>; apart from that
513the optional C<http://> or C<https://> prefix is ignored,
514as well as any userinfo and path components.
515Defaults to the environment variable C<http_proxy> if set, else C<HTTP_PROXY>
516in case no TLS is used, otherwise C<https_proxy> if set, else C<HTTPS_PROXY>.
517
518=item B<-no_proxy> I<addresses>
519
520List of IP addresses and/or DNS names of servers
521not to use an HTTP(S) proxy for, separated by commas and/or whitespace
522(where in the latter case the whole argument must be enclosed in "...").
523Default is from the environment variable C<no_proxy> if set, else C<NO_PROXY>.
524
e8769719 525=item B<-status_url> I<val>
ddac1974 526
0bae1960
MC
527Sets a fallback responder URL to use if no responder URL is present in the
528server certificate. Without this option an error is returned if the server
529certificate does not contain a responder address.
7932982b
DDO
530The optional userinfo and fragment URL components are ignored.
531Any given query component is handled as part of the path component.
ddac1974 532
e8769719 533=item B<-status_file> I<infile>
a2151c5b 534
0bae1960
MC
535Overrides any OCSP responder URLs from the certificate and always provides the
536OCSP Response stored in the file. The file must be in DER format.
a2151c5b 537
359efeac
DDO
538=item B<-ssl_config> I<val>
539
540Configure SSL_CTX using the given configuration value.
541
0bae1960 542=item B<-trace>
35d15a39 543
726f92e0 544Show verbose trace output of protocol messages.
35d15a39 545
0bae1960 546=item B<-brief>
35d15a39 547
0bae1960
MC
548Provide a brief summary of connection parameters instead of the normal verbose
549output.
35d15a39 550
0bae1960 551=item B<-rev>
19044d3c 552
04fb4ec8
HK
553Simple echo server that sends back received text reversed. Also sets B<-brief>.
554Cannot be used in conjunction with B<-early_data>.
19044d3c 555
bc8857bf
MC
556=item B<-async>
557
8c73aeb6 558Switch on asynchronous mode. Cryptographic operations will be performed
bc8857bf
MC
559asynchronously. This will only have an effect if an asynchronous capable engine
560is also used via the B<-engine> option. For test purposes the dummy async engine
561(dasync) can be used (if available).
562
e8769719 563=item B<-max_send_frag> I<+int>
28e5ea88
F
564
565The maximum size of data fragment to send.
566See L<SSL_CTX_set_max_send_fragment(3)> for further information.
567
e8769719 568=item B<-split_send_frag> I<+int>
0df80881
MC
569
570The size used to split data for encrypt pipelines. If more data is written in
571one go than this value then it will be split into multiple pipelines, up to the
572maximum number of pipelines defined by max_pipelines. This only has an effect if
c4de074e 573a suitable cipher suite has been negotiated, an engine that supports pipelining
0df80881
MC
574has been loaded, and max_pipelines is greater than 1. See
575L<SSL_CTX_set_split_send_fragment(3)> for further information.
576
e8769719 577=item B<-max_pipelines> I<+int>
0df80881
MC
578
579The maximum number of encrypt/decrypt pipelines to be used. This will only have
580an effect if an engine has been loaded that supports pipelining (e.g. the dasync
c4de074e 581engine) and a suitable cipher suite has been negotiated. The default value is 1.
0df80881
MC
582See L<SSL_CTX_set_max_pipelines(3)> for further information.
583
2b264aee
DDO
584=item B<-naccept> I<+int>
585
586The server will exit after receiving the specified number of connections,
587default unlimited.
588
e8769719 589=item B<-read_buf> I<+int>
0df80881
MC
590
591The default read buffer size to be used for connections. This will only have an
592effect if the buffer size is larger than the size that would otherwise be used
593and pipelining is in use (see L<SSL_CTX_set_default_read_buffer_len(3)> for
594further information).
595
a2151c5b
DSH
596=item B<-bugs>
597
fc4e500b 598There are several known bugs in SSL and TLS implementations. Adding this
a2151c5b
DSH
599option enables various workarounds.
600
0bae1960
MC
601=item B<-no_comp>
602
603Disable negotiation of TLS compression.
604TLS compression is not recommended and is off by default as of
605OpenSSL 1.1.0.
606
cc5a9ba4
VD
607=item B<-comp>
608
609Enable negotiation of TLS compression.
610This option was introduced in OpenSSL 1.1.0.
611TLS compression is not recommended and is off by default as of
612OpenSSL 1.1.0.
613
0bae1960 614=item B<-no_ticket>
cc5a9ba4 615
7ffb7fbe
MC
616Disable RFC4507bis session ticket support. This option has no effect if TLSv1.3
617is negotiated. See B<-num_tickets>.
618
619=item B<-num_tickets>
620
621Control the number of tickets that will be sent to the client after a full
622handshake in TLSv1.3. The default number of tickets is 2. This option does not
623affect the number of tickets sent after a resumption handshake.
cc5a9ba4 624
0bae1960 625=item B<-serverpref>
765b4137 626
0bae1960
MC
627Use the server's cipher preferences, rather than the client's preferences.
628
e1c7871d
TS
629=item B<-prioritize_chacha>
630
631Prioritize ChaCha ciphers when preferred by clients. Requires B<-serverpref>.
632
0bae1960
MC
633=item B<-no_resumption_on_reneg>
634
635Set the B<SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION> option.
765b4137 636
e8769719 637=item B<-client_sigalgs> I<val>
254b58fd
SC
638
639Signature algorithms to support for client certificate authentication
c4de074e 640(colon-separated list).
254b58fd 641
e8769719 642=item B<-named_curve> I<val>
254b58fd
SC
643
644Specifies the elliptic curve to use. NOTE: this is single curve, not a list.
645For a list of all possible curves, use:
646
647 $ openssl ecparam -list_curves
648
e8769719 649=item B<-cipher> I<val>
a2151c5b 650
9d2674cd
MC
651This allows the list of TLSv1.2 and below ciphersuites used by the server to be
652modified. This list is combined with any TLSv1.3 ciphersuites that have been
653configured. When the client sends a list of supported ciphers the first client
654cipher also included in the server list is used. Because the client specifies
655the preference order, the order of the server cipherlist is irrelevant. See
35a810bb 656L<openssl-ciphers(1)> for more information.
a2151c5b 657
e8769719 658=item B<-ciphersuites> I<val>
9d2674cd
MC
659
660This allows the list of TLSv1.3 ciphersuites used by the server to be modified.
661This list is combined with any TLSv1.2 and below ciphersuites that have been
662configured. When the client sends a list of supported ciphers the first client
663cipher also included in the server list is used. Because the client specifies
664the preference order, the order of the server cipherlist is irrelevant. See
35a810bb
RL
665L<openssl-ciphers(1)> command for more information. The format for this list is
666a simple colon (":") separated list of TLSv1.3 ciphersuite names.
9d2674cd 667
e8769719 668=item B<-dhparam> I<infile>
7b825005 669
0bae1960
MC
670The DH parameter file to use. The ephemeral DH cipher suites generate keys
671using a set of DH parameters. If not specified then an attempt is made to
672load the parameters from the server certificate file.
35a810bb
RL
673If this fails then a static set of parameters hard coded into this command
674will be used.
765b4137 675
0bae1960 676=item B<-nbio>
52b621db 677
0bae1960 678Turns on non blocking I/O.
52b621db 679
359efeac
DDO
680=item B<-timeout>
681
682Enable timeouts.
683
684=item B<-mtu>
685
686Set link-layer MTU.
687
e8769719 688=item B<-psk_identity> I<val>
9cd50f73 689
2f0ea936 690Expect the client to send PSK identity I<val> when using a PSK
0bae1960
MC
691cipher suite, and warn if they do not. By default, the expected PSK
692identity is the string "Client_identity".
9cd50f73 693
e8769719 694=item B<-psk_hint> I<val>
36086186 695
2f0ea936 696Use the PSK identity hint I<val> when using a PSK cipher suite.
36086186 697
e8769719 698=item B<-psk> I<val>
cba3f1c7 699
2f0ea936 700Use the PSK key I<val> when using a PSK cipher suite. The key is
0bae1960
MC
701given as a hexadecimal number without leading 0x, for example -psk
7021a2b3c4d.
703This option must be provided in order to use a PSK cipher.
cba3f1c7 704
e8769719 705=item B<-psk_session> I<file>
9e064bc1 706
2f0ea936 707Use the pem encoded SSL_SESSION data stored in I<file> as the basis of a PSK.
9e064bc1
MC
708Note that this will only work if TLSv1.3 is negotiated.
709
359efeac
DDO
710=item B<-srpvfile>
711
712The verifier file for SRP.
713This option is deprecated.
714
715=item B<-srpuserseed>
716
717A seed string for a default user salt.
718This option is deprecated.
719
0bae1960 720=item B<-listen>
cba3f1c7 721
0bae1960 722This option can only be used in conjunction with one of the DTLS options above.
35a810bb
RL
723With this option, this command will listen on a UDP port for incoming
724connections.
0bae1960
MC
725Any ClientHellos that arrive will be checked to see if they have a cookie in
726them or not.
727Any without a cookie will be responded to with a HelloVerifyRequest.
35a810bb
RL
728If a ClientHello with a cookie is received then this command will
729connect to that peer and complete the handshake.
cba3f1c7 730
0bae1960 731=item B<-sctp>
cba3f1c7 732
0bae1960
MC
733Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in
734conjunction with B<-dtls>, B<-dtls1> or B<-dtls1_2>. This option is only
735available where OpenSSL has support for SCTP enabled.
cba3f1c7 736
09d62b33
MT
737=item B<-sctp_label_bug>
738
739Use the incorrect behaviour of older OpenSSL implementations when computing
740endpoint-pair shared secrets for DTLS/SCTP. This allows communication with
741older broken implementations but breaks interoperability with correct
742implementations. Must be used in conjunction with B<-sctp>. This option is only
743available where OpenSSL has support for SCTP enabled.
744
359efeac
DDO
745=item B<-use_srtp>
746
747Offer SRTP key management with a colon-separated profile list.
748
0bae1960 749=item B<-no_dhe>
acf65ae5 750
0bae1960
MC
751If this option is set then no DH parameters will be loaded effectively
752disabling the ephemeral DH cipher suites.
acf65ae5 753
e8769719 754=item B<-alpn> I<val>, B<-nextprotoneg> I<val>
7efd0e77 755
dd28d1c4 756These flags enable the Application-Layer Protocol Negotiation
c4de074e
P
757or Next Protocol Negotiation (NPN) extension, respectively. ALPN is the
758IETF standard and replaces NPN.
2f0ea936 759The I<val> list is a comma-separated list of supported protocol
c4de074e 760names. The list should contain the most desirable protocols first.
7efd0e77
HK
761Protocol names are printable ASCII strings, for example "http/1.1" or
762"spdy/3".
837f87c2 763The flag B<-nextprotoneg> cannot be specified if B<-tls1_3> is used.
7efd0e77 764
cd81ac7b
TZ
765=item B<-sendfile>
766
767If this option is set and KTLS is enabled, SSL_sendfile() will be used
768instead of BIO_write() to send the HTTP response requested by a client.
769This option is only valid if B<-WWW> or B<-HTTP> is specified.
770
e8769719 771=item B<-keylogfile> I<outfile>
39176d44
PW
772
773Appends TLS secrets to the specified keylog file such that external programs
774(like Wireshark) can decrypt TLS connections.
775
e8769719 776=item B<-max_early_data> I<int>
6437b802
MC
777
778Change the default maximum early data bytes that are specified for new sessions
779and any incoming early data (when used in conjunction with the B<-early_data>
83750d9b
MC
780flag). The default value is approximately 16k. The argument must be an integer
781greater than or equal to 0.
6437b802 782
65718c51
RS
783=item B<-recv_max_early_data> I<int>
784
785Specify the hard limit on the maximum number of early data bytes that will
786be accepted.
787
6437b802
MC
788=item B<-early_data>
789
6ef40f1f
MC
790Accept early data where possible. Cannot be used in conjunction with B<-www>,
791B<-WWW>, B<-HTTP> or B<-rev>.
6437b802 792
65718c51
RS
793=item B<-stateless>
794
795Require TLSv1.3 cookies.
796
3bb5e5b0
MC
797=item B<-anti_replay>, B<-no_anti_replay>
798
799Switches replay protection on or off, respectively. Replay protection is on by
800default unless overridden by a configuration file. When it is on, OpenSSL will
801automatically detect if a session ticket has been used more than once, TLSv1.3
802has been negotiated, and early data is enabled on the server. A full handshake
803is forced if a session ticket is used a second or subsequent time. Any early
804data that was sent will be rejected.
805
bc24e3ee
RS
806{- $OpenSSL::safe::opt_name_item -}
807
d4bff20d
RS
808{- $OpenSSL::safe::opt_version_item -}
809
8b3efb53
RS
810{- $OpenSSL::safe::opt_s_item -}
811
9fcb9702
RS
812{- $OpenSSL::safe::opt_x_item -}
813
814{- $OpenSSL::safe::opt_trust_item -}
815
816{- $OpenSSL::safe::opt_r_item -}
817
018aaeb4
RS
818{- $OpenSSL::safe::opt_engine_item -}
819
6bd4e3f2
P
820{- $OpenSSL::safe::opt_provider_item -}
821
21d08b9e
RS
822{- $OpenSSL::safe::opt_v_item -}
823
824If the server requests a client certificate, then
825verification errors are displayed, for debugging, but the command will
826proceed unless the B<-verify_return_error> option is used.
827
a2151c5b
DSH
828=back
829
830=head1 CONNECTED COMMANDS
831
832If a connection request is established with an SSL client and neither the
4b08eaf5 833B<-www> nor the B<-WWW> option has been used then normally any data received
8c73aeb6 834from the client is displayed and any key presses will be sent to the client.
4b08eaf5 835
3d0dde84
MC
836Certain commands are also recognized which perform special operations. These
837commands are a letter which must appear at the start of a line. They are listed
838below.
4b08eaf5
DSH
839
840=over 4
841
842=item B<q>
843
c4de074e 844End the current SSL connection but still accept new connections.
4b08eaf5
DSH
845
846=item B<Q>
847
c4de074e 848End the current SSL connection and exit.
4b08eaf5
DSH
849
850=item B<r>
851
3d0dde84 852Renegotiate the SSL session (TLSv1.2 and below only).
4b08eaf5
DSH
853
854=item B<R>
855
3d0dde84
MC
856Renegotiate the SSL session and request a client certificate (TLSv1.2 and below
857only).
4b08eaf5
DSH
858
859=item B<P>
860
c4de074e 861Send some plain text down the underlying TCP connection: this should
4b08eaf5
DSH
862cause the client to disconnect due to a protocol violation.
863
864=item B<S>
865
c4de074e 866Print out some session cache status information.
4b08eaf5 867
3d0dde84
MC
868=item B<k>
869
870Send a key update message to the client (TLSv1.3 only)
871
872=item B<K>
873
874Send a key update message to the client and request one back (TLSv1.3 only)
875
876=item B<c>
877
878Send a certificate request to the client (TLSv1.3 only)
879
4b08eaf5 880=back
a2151c5b
DSH
881
882=head1 NOTES
883
35a810bb
RL
884This command can be used to debug SSL clients. To accept connections
885from a web browser the command:
a2151c5b
DSH
886
887 openssl s_server -accept 443 -www
888
889can be used for example.
890
a2151c5b 891Although specifying an empty list of CAs when requesting a client certificate
4b08eaf5
DSH
892is strictly speaking a protocol violation, some SSL clients interpret this to
893mean any CA is acceptable. This is useful for debugging purposes.
a2151c5b 894
35a810bb 895The session parameters can printed out using the L<openssl-sess_id(1)> command.
a2151c5b
DSH
896
897=head1 BUGS
898
8c73aeb6 899Because this program has a lot of options and also because some of the
35a810bb
RL
900techniques used are rather old, the C source for this command is rather
901hard to read and not a model of how things should be done.
8c73aeb6 902A typical SSL server program would be much simpler.
a2151c5b
DSH
903
904The output of common ciphers is wrong: it just gives the list of ciphers that
4b08eaf5 905OpenSSL recognizes and the client supports.
a2151c5b 906
35a810bb
RL
907There should be a way for this command to print out details
908of any unknown cipher suites a client says it supports.
a2151c5b
DSH
909
910=head1 SEE ALSO
911
b6b66573
DMSP
912L<openssl(1)>,
913L<openssl-sess_id(1)>,
914L<openssl-s_client(1)>,
915L<openssl-ciphers(1)>,
916L<SSL_CONF_cmd(3)>,
dfee8626
RS
917L<SSL_CTX_set_max_send_fragment(3)>,
918L<SSL_CTX_set_split_send_fragment(3)>,
fd3397fc
RL
919L<SSL_CTX_set_max_pipelines(3)>,
920L<ossl_store-file(7)>
a2151c5b 921
fa7b0111
MC
922=head1 HISTORY
923
fc5ecadd 924The -no_alt_chains option was added in OpenSSL 1.1.0.
e1c7871d 925
fc5ecadd
DMSP
926The
927-allow-no-dhe-kex and -prioritize_chacha options were added in OpenSSL 1.1.1.
fa7b0111 928
359efeac
DDO
929The B<-srpvfile>, B<-srpuserseed>, and B<-engine>
930option were deprecated in OpenSSL 3.0.
0f221d9c 931
e2f92610
RS
932=head1 COPYRIGHT
933
8020d79b 934Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
e2f92610 935
449040b4 936Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
937this file except in compliance with the License. You can obtain a copy
938in the file LICENSE in the source distribution or at
939L<https://www.openssl.org/source/license.html>.
940
941=cut