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