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