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