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