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