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