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