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