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