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