]> git.ipfire.org Git - thirdparty/openssl.git/blame - doc/man1/openssl-s_server.pod
Refactor many common flags into openssl.pod
[thirdparty/openssl.git] / doc / man1 / openssl-s_server.pod
CommitLineData
a2151c5b
DSH
1=pod
2
3=head1 NAME
4
b6b66573 5openssl-s_server - SSL/TLS server program
a2151c5b
DSH
6
7=head1 SYNOPSIS
8
a2bbe594 9B<openssl> B<s_server>
169394d4 10[B<-help>]
e8769719
RS
11[B<-port> I<+int>]
12[B<-accept> I<val>]
13[B<-unix> I<val>]
a22f9c84
E
14[B<-4>]
15[B<-6>]
0bae1960 16[B<-unlink>]
e8769719
RS
17[B<-context> I<val>]
18[B<-verify> I<int>]
19[B<-Verify> I<int>]
20[B<-cert> I<infile>]
21[B<-nameopt> I<val>]
22[B<-naccept> I<+int>]
23[B<-serverinfo> I<val>]
24[B<-certform> B<DER>|B<PEM>]
25[B<-key> I<infile>]
26[B<-keyform> I<format>]
27[B<-pass> I<val>]
28[B<-dcert> I<infile>]
29[B<-dcertform> B<DER>|B<PEM>]
30[B<-dkey> I<infile>]
31[B<-dkeyform> B<DER>|B<PEM>]
32[B<-dpass> I<val>]
a2151c5b
DSH
33[B<-nbio_test>]
34[B<-crlf>]
35[B<-debug>]
1d8634b1 36[B<-msg>]
e8769719 37[B<-msgfile> I<outfile>]
a2151c5b 38[B<-state>]
e8769719
RS
39[B<-CAfile> I<infile>]
40[B<-CApath> I<dir>]
40e2d76b
MC
41[B<-no-CAfile>]
42[B<-no-CApath>]
0bae1960
MC
43[B<-nocert>]
44[B<-quiet>]
45[B<-no_resume_ephemeral>]
46[B<-www>]
47[B<-WWW>]
48[B<-servername>]
49[B<-servername_fatal>]
8dc57d76
RL
50[B<-cert2> I<infile>]
51[B<-key2> I<infile>]
0bae1960
MC
52[B<-tlsextdebug>]
53[B<-HTTP>]
e8769719 54[B<-id_prefix> I<val>]
fed8bd90 55[B<-rand> I<files>]
e8769719
RS
56[B<-writerand> I<file>]
57[B<-keymatexport> I<val>]
58[B<-keymatexportlen> I<+int>]
59[B<-CRL> I<infile>]
0bae1960 60[B<-crl_download>]
e8769719
RS
61[B<-cert_chain> I<infile>]
62[B<-dcert_chain> I<infile>]
63[B<-chainCApath> I<dir>]
64[B<-verifyCApath> I<dir>]
0bae1960
MC
65[B<-no_cache>]
66[B<-ext_cache>]
e8769719 67[B<-CRLform> B<DER>|B<PEM>]
0bae1960
MC
68[B<-verify_return_error>]
69[B<-verify_quiet>]
70[B<-build_chain>]
e8769719
RS
71[B<-chainCAfile> I<infile>]
72[B<-verifyCAfile> I<infile>]
0bae1960
MC
73[B<-ign_eof>]
74[B<-no_ign_eof>]
75[B<-status>]
76[B<-status_verbose>]
e8769719
RS
77[B<-status_timeout> I<int>]
78[B<-status_url> I<val>]
79[B<-status_file> I<infile>]
0bae1960
MC
80[B<-trace>]
81[B<-security_debug>]
82[B<-security_debug_verbose>]
83[B<-brief>]
84[B<-rev>]
85[B<-async>]
e8769719
RS
86[B<-ssl_config> I<val>]
87[B<-max_send_frag> I<+int>]
88[B<-split_send_frag> I<+int>]
89[B<-max_pipelines> I<+int>]
90[B<-read_buf> I<+int>]
0bae1960
MC
91[B<-no_ssl3>]
92[B<-no_tls1>]
93[B<-no_tls1_1>]
94[B<-no_tls1_2>]
95[B<-no_tls1_3>]
96[B<-bugs>]
97[B<-no_comp>]
98[B<-comp>]
99[B<-no_ticket>]
7ffb7fbe 100[B<-num_tickets>]
0bae1960
MC
101[B<-serverpref>]
102[B<-legacy_renegotiation>]
103[B<-no_renegotiation>]
104[B<-legacy_server_connect>]
105[B<-no_resumption_on_reneg>]
106[B<-no_legacy_server_connect>]
4e2bd9cb 107[B<-allow_no_dhe_kex>]
e1c7871d 108[B<-prioritize_chacha>]
0bae1960 109[B<-strict>]
e8769719
RS
110[B<-sigalgs> I<val>]
111[B<-client_sigalgs> I<val>]
112[B<-groups> I<val>]
113[B<-curves> I<val>]
114[B<-named_curve> I<val>]
115[B<-cipher> I<val>]
116[B<-ciphersuites> I<val>]
117[B<-dhparam> I<infile>]
118[B<-record_padding> I<val>]
0bae1960 119[B<-debug_broken_protocol>]
e8769719
RS
120[B<-policy> I<val>]
121[B<-purpose> I<val>]
122[B<-verify_name> I<val>]
123[B<-verify_depth> I<int>]
124[B<-auth_level> I<int>]
125[B<-attime> I<intmax>]
126[B<-verify_hostname> I<val>]
127[B<-verify_email> I<val>]
0bae1960 128[B<-verify_ip>]
e42d84be 129[B<-ignore_critical>]
0bae1960
MC
130[B<-issuer_checks>]
131[B<-crl_check>]
132[B<-crl_check_all>]
133[B<-policy_check>]
134[B<-explicit_policy>]
e42d84be
HK
135[B<-inhibit_any>]
136[B<-inhibit_map>]
0bae1960
MC
137[B<-x509_strict>]
138[B<-extended_crl>]
139[B<-use_deltas>]
e42d84be 140[B<-policy_print>]
0bae1960
MC
141[B<-check_ss_sig>]
142[B<-trusted_first>]
e42d84be 143[B<-suiteB_128_only>]
0bae1960 144[B<-suiteB_128>]
e42d84be 145[B<-suiteB_192>]
0bae1960 146[B<-partial_chain>]
fa7b0111 147[B<-no_alt_chains>]
0bae1960
MC
148[B<-no_check_time>]
149[B<-allow_proxy_certs>]
150[B<-xkey>]
151[B<-xcert>]
152[B<-xchain>]
153[B<-xchain_build>]
e8769719
RS
154[B<-xcertform> B<DER>|B<PEM>]
155[B<-xkeyform> B<DER>|B<PEM>]
0bae1960 156[B<-nbio>]
e8769719
RS
157[B<-psk_identity> I<val>]
158[B<-psk_hint> I<val>]
159[B<-psk> I<val>]
160[B<-psk_session> I<file>]
161[B<-srpvfile> I<infile>]
162[B<-srpuserseed> I<val>]
a2151c5b
DSH
163[B<-ssl3>]
164[B<-tls1>]
582a17d6
MC
165[B<-tls1_1>]
166[B<-tls1_2>]
167[B<-tls1_3>]
35d15a39 168[B<-dtls>]
0bae1960 169[B<-timeout>]
e8769719 170[B<-mtu> I<+int>]
0bae1960 171[B<-listen>]
35d15a39
MC
172[B<-dtls1>]
173[B<-dtls1_2>]
19044d3c 174[B<-sctp>]
09d62b33 175[B<-sctp_label_bug>]
a2151c5b 176[B<-no_dhe>]
e8769719
RS
177[B<-nextprotoneg> I<val>]
178[B<-use_srtp> I<val>]
179[B<-alpn> I<val>]
180[B<-engine> I<val>]
181[B<-keylogfile> I<outfile>]
182[B<-max_early_data> I<int>]
6437b802 183[B<-early_data>]
3bb5e5b0
MC
184[B<-anti_replay>]
185[B<-no_anti_replay>]
c3be39f2 186[B<-http_server_binmode>]
7efd0e77 187
9f3c076b 188=for openssl ifdef unix 4 6 unlink no_dhe nextprotoneg use_srtp engine
1738c0ce 189
9f3c076b 190=for openssl ifdef status status_verbose status_timeout status_url status_file
1738c0ce 191
9f3c076b 192=for openssl ifdef psk_hint srpvfile srpuserseed sctp sctp_label_bug
1738c0ce 193
9f3c076b 194=for openssl ifdef sctp sctp_label_bug trace mtu timeout listen
1738c0ce 195
9f3c076b 196=for openssl ifdef ssl3 tls1 tls1_1 tls1_2 tls1_3 dtls mtu dtls1 dtls1_2
1738c0ce 197
a2151c5b
DSH
198=head1 DESCRIPTION
199
35a810bb
RL
200This command implements a generic SSL/TLS server which
201listens for connections on a given port using SSL/TLS.
a2151c5b
DSH
202
203=head1 OPTIONS
204
35a810bb
RL
205In addition to the options below, this command also supports
206the common and server only options documented
f5c14c63 207L<SSL_CONF_cmd(3)/Supported Command Line Commands>
765b4137 208
a2151c5b
DSH
209=over 4
210
169394d4
MR
211=item B<-help>
212
213Print out a usage message.
214
e8769719 215=item B<-port> I<+int>
a2151c5b 216
8c73aeb6 217The TCP port to listen on for connections. If not specified 4433 is used.
a2151c5b 218
e8769719 219=item B<-accept> I<val>
a22f9c84
E
220
221The optional TCP host and port to listen on for connections. If not specified, *:4433 is used.
222
e8769719 223=item B<-unix> I<val>
a22f9c84
E
224
225Unix domain socket to accept on.
226
a22f9c84
E
227=item B<-4>
228
229Use IPv4 only.
230
231=item B<-6>
232
233Use IPv6 only.
234
0bae1960
MC
235=item B<-unlink>
236
237For -unix, unlink any existing socket first.
238
e8769719 239=item B<-context> I<val>
a2151c5b 240
8c73aeb6 241Sets the SSL context id. It can be given any string value. If this option
cc8709a0 242is not present a default value will be used.
a2151c5b 243
e8769719 244=item B<-verify> I<int>, B<-Verify> I<int>
0bae1960
MC
245
246The verify depth to use. This specifies the maximum length of the
247client certificate chain and makes the server request a certificate from
248the client. With the B<-verify> option a certificate is requested but the
249client does not have to send one, with the B<-Verify> option the client
250must supply a certificate or an error occurs.
251
252If the cipher suite cannot request a client certificate (for example an
253anonymous cipher suite or PSK) this option has no effect.
254
e8769719 255=item B<-cert> I<infile>
a2151c5b
DSH
256
257The certificate to use, most servers cipher suites require the use of a
258certificate and some require a certificate with a certain public key type:
259for example the DSS cipher suites require a certificate containing a DSS
1948394d 260(DSA) key. If not specified then the filename F<server.pem> will be used.
a2151c5b 261
7cacbe9d
DB
262=item B<-cert_chain>
263
264A file containing trusted certificates to use when attempting to build the
265client/server certificate chain related to the certificate specified via the
266B<-cert> option.
267
268=item B<-build_chain>
269
270Specify whether the application should build the certificate chain to be
271provided to the client.
272
e8769719 273=item B<-nameopt> I<val>
0bae1960
MC
274
275Option which determines how the subject or issuer names are displayed. The
2f0ea936 276I<val> argument can be a single option or multiple options separated by
0bae1960 277commas. Alternatively the B<-nameopt> switch may be used more than once to
8bc93d2f 278set multiple options. See the L<openssl-x509(1)> manual page for details.
0bae1960 279
e8769719 280=item B<-naccept> I<+int>
0bae1960
MC
281
282The server will exit after receiving the specified number of connections,
283default unlimited.
284
e8769719 285=item B<-serverinfo> I<val>
0bae1960
MC
286
287A file containing one or more blocks of PEM data. Each PEM block
288must encode a TLS ServerHello extension (2 bytes type, 2 bytes length,
289followed by "length" bytes of extension data). If the client sends
290an empty TLS ClientHello extension matching the type, the corresponding
291ServerHello extension will be returned.
292
e8769719 293=item B<-certform> B<DER>|B<PEM>
826a42a0
DSH
294
295The certificate format to use: DER or PEM. PEM is the default.
296
e8769719 297=item B<-key> I<infile>
a2151c5b
DSH
298
299The private key to use. If not specified then the certificate file will
300be used.
301
e8769719 302=item B<-keyform> I<format>
826a42a0
DSH
303
304The private format to use: DER or PEM. PEM is the default.
305
e8769719 306=item B<-pass> I<val>
826a42a0 307
0bae1960 308The private key password source. For more information about the format of B<val>
3a4e43de 309see L<openssl(1)/Pass Phrase Options>.
826a42a0 310
e8769719 311=item B<-dcert> I<infile>, B<-dkey> I<infile>
a2151c5b 312
8c73aeb6 313Specify an additional certificate and private key, these behave in the
a2151c5b
DSH
314same manner as the B<-cert> and B<-key> options except there is no default
315if they are not specified (no additional certificate and key is used). As
316noted above some cipher suites require a certificate containing a key of
317a certain type. Some cipher suites need a certificate carrying an RSA key
318and some a DSS (DSA) key. By using RSA and DSS certificates and keys
319a server can support clients which only support RSA or DSS cipher suites
320by using an appropriate certificate.
321
7cacbe9d
DB
322=item B<-dcert_chain>
323
324A file containing trusted certificates to use when attempting to build the
325server certificate chain when a certificate specified via the B<-dcert> option
326is in use.
327
e8769719 328=item B<-dcertform> B<DER>|B<PEM>, B<-dkeyform> B<DER>|B<PEM>, B<-dpass> I<val>
826a42a0 329
8c73aeb6 330Additional certificate and private key format and passphrase respectively.
826a42a0 331
e8769719 332=item B<-xkey> I<infile>, B<-xcert> I<infile>, B<-xchain>
7cacbe9d
DB
333
334Specify an extra certificate, private key and certificate chain. These behave
335in the same manner as the B<-cert>, B<-key> and B<-cert_chain> options. When
336specified, the callback returning the first valid chain will be in use by
337the server.
338
339=item B<-xchain_build>
340
341Specify whether the application should build the certificate chain to be
e8769719
RS
342provided to the client for the extra certificates provided via B<-xkey> I<infile>,
343B<-xcert> I<infile>, B<-xchain> options.
7cacbe9d 344
e8769719 345=item B<-xcertform> B<DER>|B<PEM>, B<-xkeyform> B<DER>|B<PEM>
7cacbe9d
DB
346
347Extra certificate and private key format respectively.
348
0bae1960 349=item B<-nbio_test>
a2151c5b 350
0bae1960 351Tests non blocking I/O.
a2151c5b 352
0bae1960 353=item B<-crlf>
a2151c5b 354
0bae1960 355This option translated a line feed from the terminal into CR+LF.
a2151c5b 356
0bae1960 357=item B<-debug>
a2151c5b 358
0bae1960 359Print extensive debugging information including a hex dump of all traffic.
a2151c5b 360
0bae1960 361=item B<-msg>
51e00db2 362
0bae1960 363Show all protocol messages with hex dump.
51e00db2 364
e8769719 365=item B<-msgfile> I<outfile>
a2151c5b 366
0bae1960 367File to send output of B<-msg> or B<-trace> to, default standard output.
a2151c5b 368
0bae1960
MC
369=item B<-state>
370
371Prints the SSL session states.
372
a397aca4 373=item B<-CAfile> I<file>, B<-no-CAfile>, B<-CApath> I<dir>, B<-no-CApath>
a2151c5b 374
a397aca4 375See L<openssl(1)/Trusted Certificate Options> for more information.
0bae1960 376
e8769719 377=item B<-chainCApath> I<dir>
7cacbe9d
DB
378
379The directory to use for building the chain provided to the client. This
8bc93d2f
RL
380directory must be in "hash format", see L<openssl-verify(1)> for more
381information.
7cacbe9d 382
e8769719 383=item B<-chainCAfile> I<file>
7cacbe9d
DB
384
385A file containing trusted certificates to use when attempting to build the
386server certificate chain.
387
0bae1960 388=item B<-nocert>
8d419330 389
0bae1960
MC
390If this option is set then no certificate is used. This restricts the
391cipher suites available to the anonymous ones (currently just anonymous
392DH).
8d419330 393
0bae1960 394=item B<-quiet>
a2151c5b 395
0bae1960 396Inhibit printing of session and certificate information.
a2151c5b 397
0bae1960 398=item B<-www>
a2151c5b 399
0bae1960
MC
400Sends a status message back to the client when it connects. This includes
401information about the ciphers used and various session parameters.
402The output is in HTML format so this option will normally be used with a
6ef40f1f 403web browser. Cannot be used in conjunction with B<-early_data>.
a2151c5b 404
0bae1960 405=item B<-WWW>
1d8634b1 406
0bae1960
MC
407Emulates a simple web server. Pages will be resolved relative to the
408current directory, for example if the URL https://myhost/page.html is
1948394d 409requested the file F<./page.html> will be loaded. Cannot be used in conjunction
6ef40f1f 410with B<-early_data>.
1d8634b1 411
0bae1960 412=item B<-tlsextdebug>
8dbeb110 413
0bae1960 414Print a hex dump of any TLS extensions received from the server.
8dbeb110 415
0bae1960 416=item B<-HTTP>
8dbeb110 417
0bae1960
MC
418Emulates a simple web server. Pages will be resolved relative to the
419current directory, for example if the URL https://myhost/page.html is
1948394d 420requested the file F<./page.html> will be loaded. The files loaded are
0bae1960 421assumed to contain a complete and correct HTTP response (lines that
6ef40f1f
MC
422are part of the HTTP response line and headers must end with CRLF). Cannot be
423used in conjunction with B<-early_data>.
8dbeb110 424
e8769719 425=item B<-id_prefix> I<val>
a2151c5b 426
2f0ea936 427Generate SSL/TLS session IDs prefixed by I<val>. This is mostly useful
0bae1960
MC
428for testing any SSL/TLS code (eg. proxies) that wish to deal with multiple
429servers, when each of which might be generating a unique range of session
430IDs (eg. with a certain prefix).
a2151c5b 431
a397aca4 432=item B<-rand> I<files>, B<-writerand> I<file>
3ee1eac2 433
a397aca4 434See L<openssl(1)/Random State Options> for more information.
3ee1eac2 435
0bae1960 436=item B<-verify_return_error>
a2151c5b 437
0bae1960
MC
438Verification errors normally just print a message but allow the
439connection to continue, for debugging purposes.
440If this option is used, then verification errors close the connection.
a2151c5b 441
0bae1960 442=item B<-status>
a2151c5b 443
0bae1960 444Enables certificate status request support (aka OCSP stapling).
a2151c5b 445
0bae1960 446=item B<-status_verbose>
ddac1974 447
0bae1960
MC
448Enables certificate status request support (aka OCSP stapling) and gives
449a verbose printout of the OCSP response.
ddac1974 450
e8769719 451=item B<-status_timeout> I<int>
720b6cbe 452
2f0ea936 453Sets the timeout for OCSP response to I<int> seconds.
720b6cbe 454
e8769719 455=item B<-status_url> I<val>
ddac1974 456
0bae1960
MC
457Sets a fallback responder URL to use if no responder URL is present in the
458server certificate. Without this option an error is returned if the server
459certificate does not contain a responder address.
ddac1974 460
e8769719 461=item B<-status_file> I<infile>
a2151c5b 462
0bae1960
MC
463Overrides any OCSP responder URLs from the certificate and always provides the
464OCSP Response stored in the file. The file must be in DER format.
a2151c5b 465
0bae1960 466=item B<-trace>
35d15a39 467
0bae1960
MC
468Show verbose trace output of protocol messages. OpenSSL needs to be compiled
469with B<enable-ssl-trace> for this option to work.
35d15a39 470
0bae1960 471=item B<-brief>
35d15a39 472
0bae1960
MC
473Provide a brief summary of connection parameters instead of the normal verbose
474output.
35d15a39 475
0bae1960 476=item B<-rev>
19044d3c 477
0bae1960 478Simple test server which just reverses the text received from the client
6ef40f1f
MC
479and sends it back to the server. Also sets B<-brief>. Cannot be used in
480conjunction with B<-early_data>.
19044d3c 481
bc8857bf
MC
482=item B<-async>
483
8c73aeb6 484Switch on asynchronous mode. Cryptographic operations will be performed
bc8857bf
MC
485asynchronously. This will only have an effect if an asynchronous capable engine
486is also used via the B<-engine> option. For test purposes the dummy async engine
487(dasync) can be used (if available).
488
e8769719 489=item B<-max_send_frag> I<+int>
28e5ea88
F
490
491The maximum size of data fragment to send.
492See L<SSL_CTX_set_max_send_fragment(3)> for further information.
493
e8769719 494=item B<-split_send_frag> I<+int>
0df80881
MC
495
496The size used to split data for encrypt pipelines. If more data is written in
497one go than this value then it will be split into multiple pipelines, up to the
498maximum number of pipelines defined by max_pipelines. This only has an effect if
c4de074e 499a suitable cipher suite has been negotiated, an engine that supports pipelining
0df80881
MC
500has been loaded, and max_pipelines is greater than 1. See
501L<SSL_CTX_set_split_send_fragment(3)> for further information.
502
e8769719 503=item B<-max_pipelines> I<+int>
0df80881
MC
504
505The maximum number of encrypt/decrypt pipelines to be used. This will only have
506an effect if an engine has been loaded that supports pipelining (e.g. the dasync
c4de074e 507engine) and a suitable cipher suite has been negotiated. The default value is 1.
0df80881
MC
508See L<SSL_CTX_set_max_pipelines(3)> for further information.
509
e8769719 510=item B<-read_buf> I<+int>
0df80881
MC
511
512The default read buffer size to be used for connections. This will only have an
513effect if the buffer size is larger than the size that would otherwise be used
514and pipelining is in use (see L<SSL_CTX_set_default_read_buffer_len(3)> for
515further information).
516
0bae1960
MC
517=item B<-ssl2>, B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-tls1_3>, B<-no_ssl2>, B<-no_ssl3>, B<-no_tls1>, B<-no_tls1_1>, B<-no_tls1_2>, B<-no_tls1_3>
518
519These options require or disable the use of the specified SSL or TLS protocols.
35a810bb
RL
520By default, this command will negotiate the highest mutually supported
521protocol version.
0bae1960
MC
522When a specific TLS version is required, only that version will be accepted
523from the client.
ed4fc853
RS
524Note that not all protocols and flags may be available, depending on how
525OpenSSL was built.
0bae1960 526
a2151c5b
DSH
527=item B<-bugs>
528
fc4e500b 529There are several known bugs in SSL and TLS implementations. Adding this
a2151c5b
DSH
530option enables various workarounds.
531
0bae1960
MC
532=item B<-no_comp>
533
534Disable negotiation of TLS compression.
535TLS compression is not recommended and is off by default as of
536OpenSSL 1.1.0.
537
cc5a9ba4
VD
538=item B<-comp>
539
540Enable negotiation of TLS compression.
541This option was introduced in OpenSSL 1.1.0.
542TLS compression is not recommended and is off by default as of
543OpenSSL 1.1.0.
544
0bae1960 545=item B<-no_ticket>
cc5a9ba4 546
7ffb7fbe
MC
547Disable RFC4507bis session ticket support. This option has no effect if TLSv1.3
548is negotiated. See B<-num_tickets>.
549
550=item B<-num_tickets>
551
552Control the number of tickets that will be sent to the client after a full
553handshake in TLSv1.3. The default number of tickets is 2. This option does not
554affect the number of tickets sent after a resumption handshake.
cc5a9ba4 555
0bae1960 556=item B<-serverpref>
765b4137 557
0bae1960
MC
558Use the server's cipher preferences, rather than the client's preferences.
559
e1c7871d
TS
560=item B<-prioritize_chacha>
561
562Prioritize ChaCha ciphers when preferred by clients. Requires B<-serverpref>.
563
0bae1960
MC
564=item B<-no_resumption_on_reneg>
565
566Set the B<SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION> option.
765b4137 567
e8769719 568=item B<-client_sigalgs> I<val>
254b58fd
SC
569
570Signature algorithms to support for client certificate authentication
c4de074e 571(colon-separated list).
254b58fd 572
e8769719 573=item B<-named_curve> I<val>
254b58fd
SC
574
575Specifies the elliptic curve to use. NOTE: this is single curve, not a list.
576For a list of all possible curves, use:
577
578 $ openssl ecparam -list_curves
579
e8769719 580=item B<-cipher> I<val>
a2151c5b 581
9d2674cd
MC
582This allows the list of TLSv1.2 and below ciphersuites used by the server to be
583modified. This list is combined with any TLSv1.3 ciphersuites that have been
584configured. When the client sends a list of supported ciphers the first client
585cipher also included in the server list is used. Because the client specifies
586the preference order, the order of the server cipherlist is irrelevant. See
35a810bb 587L<openssl-ciphers(1)> for more information.
a2151c5b 588
e8769719 589=item B<-ciphersuites> I<val>
9d2674cd
MC
590
591This allows the list of TLSv1.3 ciphersuites used by the server to be modified.
592This list is combined with any TLSv1.2 and below ciphersuites that have been
593configured. When the client sends a list of supported ciphers the first client
594cipher also included in the server list is used. Because the client specifies
595the preference order, the order of the server cipherlist is irrelevant. See
35a810bb
RL
596L<openssl-ciphers(1)> command for more information. The format for this list is
597a simple colon (":") separated list of TLSv1.3 ciphersuite names.
9d2674cd 598
e8769719 599=item B<-dhparam> I<infile>
7b825005 600
0bae1960
MC
601The DH parameter file to use. The ephemeral DH cipher suites generate keys
602using a set of DH parameters. If not specified then an attempt is made to
603load the parameters from the server certificate file.
35a810bb
RL
604If this fails then a static set of parameters hard coded into this command
605will be used.
765b4137 606
0bae1960
MC
607=item B<-attime>, B<-check_ss_sig>, B<-crl_check>, B<-crl_check_all>,
608B<-explicit_policy>, B<-extended_crl>, B<-ignore_critical>, B<-inhibit_any>,
609B<-inhibit_map>, B<-no_alt_chains>, B<-no_check_time>, B<-partial_chain>, B<-policy>,
610B<-policy_check>, B<-policy_print>, B<-purpose>, B<-suiteB_128>,
611B<-suiteB_128_only>, B<-suiteB_192>, B<-trusted_first>, B<-use_deltas>,
612B<-auth_level>, B<-verify_depth>, B<-verify_email>, B<-verify_hostname>,
613B<-verify_ip>, B<-verify_name>, B<-x509_strict>
5270e702 614
0bae1960 615Set different peer certificate verification options.
8bc93d2f 616See the L<openssl-verify(1)> manual page for details.
5270e702 617
0bae1960 618=item B<-crl_check>, B<-crl_check_all>
e986704d 619
0bae1960
MC
620Check the peer certificate has not been revoked by its CA.
621The CRL(s) are appended to the certificate file. With the B<-crl_check_all>
622option all CRLs of all CAs in the chain are checked.
e986704d 623
0bae1960 624=item B<-nbio>
52b621db 625
0bae1960 626Turns on non blocking I/O.
52b621db 627
e8769719 628=item B<-psk_identity> I<val>
9cd50f73 629
2f0ea936 630Expect the client to send PSK identity I<val> when using a PSK
0bae1960
MC
631cipher suite, and warn if they do not. By default, the expected PSK
632identity is the string "Client_identity".
9cd50f73 633
e8769719 634=item B<-psk_hint> I<val>
36086186 635
2f0ea936 636Use the PSK identity hint I<val> when using a PSK cipher suite.
36086186 637
e8769719 638=item B<-psk> I<val>
cba3f1c7 639
2f0ea936 640Use the PSK key I<val> when using a PSK cipher suite. The key is
0bae1960
MC
641given as a hexadecimal number without leading 0x, for example -psk
6421a2b3c4d.
643This option must be provided in order to use a PSK cipher.
cba3f1c7 644
e8769719 645=item B<-psk_session> I<file>
9e064bc1 646
2f0ea936 647Use the pem encoded SSL_SESSION data stored in I<file> as the basis of a PSK.
9e064bc1
MC
648Note that this will only work if TLSv1.3 is negotiated.
649
0bae1960 650=item B<-listen>
cba3f1c7 651
0bae1960 652This option can only be used in conjunction with one of the DTLS options above.
35a810bb
RL
653With this option, this command will listen on a UDP port for incoming
654connections.
0bae1960
MC
655Any ClientHellos that arrive will be checked to see if they have a cookie in
656them or not.
657Any without a cookie will be responded to with a HelloVerifyRequest.
35a810bb
RL
658If a ClientHello with a cookie is received then this command will
659connect to that peer and complete the handshake.
cba3f1c7 660
0bae1960 661=item B<-dtls>, B<-dtls1>, B<-dtls1_2>
cba3f1c7 662
35a810bb
RL
663These options make this command use DTLS protocols instead of TLS.
664With B<-dtls>, it will negotiate any supported DTLS protocol
665version, whilst B<-dtls1> and B<-dtls1_2> will only support DTLSv1.0 and
666DTLSv1.2 respectively.
cba3f1c7 667
0bae1960 668=item B<-sctp>
cba3f1c7 669
0bae1960
MC
670Use SCTP for the transport protocol instead of UDP in DTLS. Must be used in
671conjunction with B<-dtls>, B<-dtls1> or B<-dtls1_2>. This option is only
672available where OpenSSL has support for SCTP enabled.
cba3f1c7 673
09d62b33
MT
674=item B<-sctp_label_bug>
675
676Use the incorrect behaviour of older OpenSSL implementations when computing
677endpoint-pair shared secrets for DTLS/SCTP. This allows communication with
678older broken implementations but breaks interoperability with correct
679implementations. Must be used in conjunction with B<-sctp>. This option is only
680available where OpenSSL has support for SCTP enabled.
681
0bae1960 682=item B<-no_dhe>
acf65ae5 683
0bae1960
MC
684If this option is set then no DH parameters will be loaded effectively
685disabling the ephemeral DH cipher suites.
acf65ae5 686
e8769719 687=item B<-alpn> I<val>, B<-nextprotoneg> I<val>
7efd0e77 688
c4de074e
P
689These flags enable the Enable the Application-Layer Protocol Negotiation
690or Next Protocol Negotiation (NPN) extension, respectively. ALPN is the
691IETF standard and replaces NPN.
2f0ea936 692The I<val> list is a comma-separated list of supported protocol
c4de074e 693names. The list should contain the most desirable protocols first.
7efd0e77
HK
694Protocol names are printable ASCII strings, for example "http/1.1" or
695"spdy/3".
837f87c2 696The flag B<-nextprotoneg> cannot be specified if B<-tls1_3> is used.
7efd0e77 697
e8769719 698=item B<-engine> I<val>
0bae1960 699
35a810bb
RL
700Specifying an engine (by its unique id string in I<val>) will cause
701this command to attempt to obtain a functional reference to the
702specified engine, thus initialising it if needed. The engine will then be
703set as the default for all available algorithms.
0bae1960 704
e8769719 705=item B<-keylogfile> I<outfile>
39176d44
PW
706
707Appends TLS secrets to the specified keylog file such that external programs
708(like Wireshark) can decrypt TLS connections.
709
e8769719 710=item B<-max_early_data> I<int>
6437b802
MC
711
712Change the default maximum early data bytes that are specified for new sessions
713and any incoming early data (when used in conjunction with the B<-early_data>
83750d9b
MC
714flag). The default value is approximately 16k. The argument must be an integer
715greater than or equal to 0.
6437b802
MC
716
717=item B<-early_data>
718
6ef40f1f
MC
719Accept early data where possible. Cannot be used in conjunction with B<-www>,
720B<-WWW>, B<-HTTP> or B<-rev>.
6437b802 721
3bb5e5b0
MC
722=item B<-anti_replay>, B<-no_anti_replay>
723
724Switches replay protection on or off, respectively. Replay protection is on by
725default unless overridden by a configuration file. When it is on, OpenSSL will
726automatically detect if a session ticket has been used more than once, TLSv1.3
727has been negotiated, and early data is enabled on the server. A full handshake
728is forced if a session ticket is used a second or subsequent time. Any early
729data that was sent will be rejected.
730
c3be39f2
LZ
731=item B<-http_server_binmode>
732
733When acting as web-server (using option B<-WWW> or B<-HTTP>) open files requested
734by the client in binary mode.
735
a2151c5b
DSH
736=back
737
738=head1 CONNECTED COMMANDS
739
740If a connection request is established with an SSL client and neither the
4b08eaf5 741B<-www> nor the B<-WWW> option has been used then normally any data received
8c73aeb6 742from the client is displayed and any key presses will be sent to the client.
4b08eaf5 743
3d0dde84
MC
744Certain commands are also recognized which perform special operations. These
745commands are a letter which must appear at the start of a line. They are listed
746below.
4b08eaf5
DSH
747
748=over 4
749
750=item B<q>
751
c4de074e 752End the current SSL connection but still accept new connections.
4b08eaf5
DSH
753
754=item B<Q>
755
c4de074e 756End the current SSL connection and exit.
4b08eaf5
DSH
757
758=item B<r>
759
3d0dde84 760Renegotiate the SSL session (TLSv1.2 and below only).
4b08eaf5
DSH
761
762=item B<R>
763
3d0dde84
MC
764Renegotiate the SSL session and request a client certificate (TLSv1.2 and below
765only).
4b08eaf5
DSH
766
767=item B<P>
768
c4de074e 769Send some plain text down the underlying TCP connection: this should
4b08eaf5
DSH
770cause the client to disconnect due to a protocol violation.
771
772=item B<S>
773
c4de074e 774Print out some session cache status information.
4b08eaf5 775
3d0dde84
MC
776=item B<k>
777
778Send a key update message to the client (TLSv1.3 only)
779
780=item B<K>
781
782Send a key update message to the client and request one back (TLSv1.3 only)
783
784=item B<c>
785
786Send a certificate request to the client (TLSv1.3 only)
787
4b08eaf5 788=back
a2151c5b
DSH
789
790=head1 NOTES
791
35a810bb
RL
792This command can be used to debug SSL clients. To accept connections
793from a web browser the command:
a2151c5b
DSH
794
795 openssl s_server -accept 443 -www
796
797can be used for example.
798
a2151c5b 799Although specifying an empty list of CAs when requesting a client certificate
4b08eaf5
DSH
800is strictly speaking a protocol violation, some SSL clients interpret this to
801mean any CA is acceptable. This is useful for debugging purposes.
a2151c5b 802
35a810bb 803The session parameters can printed out using the L<openssl-sess_id(1)> command.
a2151c5b
DSH
804
805=head1 BUGS
806
8c73aeb6 807Because this program has a lot of options and also because some of the
35a810bb
RL
808techniques used are rather old, the C source for this command is rather
809hard to read and not a model of how things should be done.
8c73aeb6 810A typical SSL server program would be much simpler.
a2151c5b
DSH
811
812The output of common ciphers is wrong: it just gives the list of ciphers that
4b08eaf5 813OpenSSL recognizes and the client supports.
a2151c5b 814
35a810bb
RL
815There should be a way for this command to print out details
816of any unknown cipher suites a client says it supports.
a2151c5b
DSH
817
818=head1 SEE ALSO
819
b6b66573
DMSP
820L<openssl(1)>,
821L<openssl-sess_id(1)>,
822L<openssl-s_client(1)>,
823L<openssl-ciphers(1)>,
824L<SSL_CONF_cmd(3)>,
dfee8626
RS
825L<SSL_CTX_set_max_send_fragment(3)>,
826L<SSL_CTX_set_split_send_fragment(3)>,
df443918 827L<SSL_CTX_set_max_pipelines(3)>
a2151c5b 828
fa7b0111
MC
829=head1 HISTORY
830
fc5ecadd 831The -no_alt_chains option was added in OpenSSL 1.1.0.
e1c7871d 832
fc5ecadd
DMSP
833The
834-allow-no-dhe-kex and -prioritize_chacha options were added in OpenSSL 1.1.1.
fa7b0111 835
e2f92610
RS
836=head1 COPYRIGHT
837
b6b66573 838Copyright 2000-2019 The OpenSSL Project Authors. All Rights Reserved.
e2f92610 839
449040b4 840Licensed under the Apache License 2.0 (the "License"). You may not use
e2f92610
RS
841this file except in compliance with the License. You can obtain a copy
842in the file LICENSE in the source distribution or at
843L<https://www.openssl.org/source/license.html>.
844
845=cut