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