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