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