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