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