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