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