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