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