NAME

openssl-s_server, s_server - SSL/TLS server program

SYNOPSIS

openssl s_server [-help] [-port +int] [-accept val] [-unix val] [-4] [-6] [-unlink] [-context val] [-verify int] [-Verify int] [-cert infile] [-nameopt val] [-naccept +int] [-serverinfo val] [-certform PEM|DER] [-key infile] [-keyform format] [-pass val] [-dcert infile] [-dcertform PEM|DER] [-dkey infile] [-dkeyform PEM|DER] [-dpass val] [-nbio_test] [-crlf] [-debug] [-msg] [-msgfile outfile] [-state] [-CAfile infile] [-CApath dir] [-no-CAfile] [-no-CApath] [-nocert] [-quiet] [-no_resume_ephemeral] [-www] [-WWW] [-servername] [-servername_fatal] [-cert2 infile] [-key2 infile] [-tlsextdebug] [-HTTP] [-id_prefix val] [-rand file...] [-writerand file] [-keymatexport val] [-keymatexportlen +int] [-CRL infile] [-crl_download] [-cert_chain infile] [-dcert_chain infile] [-chainCApath dir] [-verifyCApath dir] [-no_cache] [-ext_cache] [-CRLform PEM|DER] [-verify_return_error] [-verify_quiet] [-build_chain] [-chainCAfile infile] [-verifyCAfile infile] [-ign_eof] [-no_ign_eof] [-status] [-status_verbose] [-status_timeout int] [-status_url val] [-status_file infile] [-trace] [-security_debug] [-security_debug_verbose] [-brief] [-rev] [-async] [-ssl_config val] [-max_send_frag +int] [-split_send_frag +int] [-max_pipelines +int] [-read_buf +int] [-no_ssl3] [-no_tls1] [-no_tls1_1] [-no_tls1_2] [-no_tls1_3] [-bugs] [-no_comp] [-comp] [-no_ticket] [-num_tickets] [-serverpref] [-legacy_renegotiation] [-no_renegotiation] [-legacy_server_connect] [-no_resumption_on_reneg] [-no_legacy_server_connect] [-allow_no_dhe_kex] [-prioritize_chacha] [-strict] [-sigalgs val] [-client_sigalgs val] [-groups val] [-curves val] [-named_curve val] [-cipher val] [-ciphersuites val] [-dhparam infile] [-record_padding val] [-debug_broken_protocol] [-policy val] [-purpose val] [-verify_name val] [-verify_depth int] [-auth_level int] [-attime intmax] [-verify_hostname val] [-verify_email val] [-verify_ip] [-ignore_critical] [-issuer_checks] [-crl_check] [-crl_check_all] [-policy_check] [-explicit_policy] [-inhibit_any] [-inhibit_map] [-x509_strict] [-extended_crl] [-use_deltas] [-policy_print] [-check_ss_sig] [-trusted_first] [-suiteB_128_only] [-suiteB_128] [-suiteB_192] [-partial_chain] [-no_alt_chains] [-no_check_time] [-allow_proxy_certs] [-xkey] [-xcert] [-xchain] [-xchain_build] [-xcertform PEM|DER] [-xkeyform PEM|DER] [-nbio] [-psk_identity val] [-psk_hint val] [-psk val] [-psk_session file] [-srpvfile infile] [-srpuserseed val] [-ssl3] [-tls1] [-tls1_1] [-tls1_2] [-tls1_3] [-dtls] [-timeout] [-mtu +int] [-listen] [-dtls1] [-dtls1_2] [-sctp] [-sctp_label_bug] [-no_dhe] [-nextprotoneg val] [-use_srtp val] [-alpn val] [-engine val] [-keylogfile outfile] [-max_early_data int] [-early_data] [-anti_replay] [-no_anti_replay]

DESCRIPTION

The s_server command implements a generic SSL/TLS server which listens for connections on a given port using SSL/TLS.

OPTIONS

In addition to the options below the s_server utility also supports the common and server only options documented in the Supported Command Line Commands section of the SSL_CONF_cmd (3) manual page.

CONNECTED COMMANDS

If a connection request is established with an SSL client and neither the -www nor the -WWW option has been used then normally any data received from the client is displayed and any key presses will be sent to the client.

Certain commands are also recognized which perform special operations. These commands are a letter which must appear at the start of a line. They are listed below.

  1. End the current SSL connection but still accept new connections.

  1. End the current SSL connection and exit.

  1. Renegotiate the SSL session (TLSv1.2 and below only).

  1. Renegotiate the SSL session and request a client certificate (TLSv1.2 and below only).

  2. Send some plain text down the underlying TCP connection: this should cause the client to disconnect due to a protocol violation.

  3. Print out some session cache status information.

  4. Send a heartbeat message to the client (DTLS only)

  1. Send a key update message to the client (TLSv1.3 only)

  1. Send a key update message to the client and request one back (TLSv1.3 only)

  1. Send a certificate request to the client (TLSv1.3 only)

NOTES

s_server can be used to debug SSL clients. To accept connections from a web browser the command:

openssl s_server -accept 443 -www

can be used for example.

Although specifying an empty list of CAs when requesting a client certificate is strictly speaking a protocol violation, some SSL clients interpret this to mean any CA is acceptable. This is useful for debugging purposes.

The session parameters can printed out using the sess_id program.

BUGS

Because this program has a lot of options and also because some of the techniques used are rather old, the C source of s_server is rather hard to read and not a model of how things should be done. A typical SSL server program would be much simpler.

The output of common ciphers is wrong: it just gives the list of ciphers that OpenSSL recognizes and the client supports.

There should be a way for the s_server program to print out details of any unknown cipher suites a client says it supports.

SEE ALSO

SSL_CONF_cmd (3), sess_id (1), s_client (1), ciphers (1) SSL_CTX_set_max_send_fragment (3), SSL_CTX_set_split_send_fragment (3), SSL_CTX_set_max_pipelines (3)

HISTORY

The -no_alt_chains option was added in OpenSSL 1.1.0.

The -allow-no-dhe-kex and -prioritize_chacha options were added in OpenSSL 1.1.1.

COPYRIGHT

Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the OpenSSL license (the License). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.