1S_SERVER(1)                         OpenSSL                        S_SERVER(1)
2
3
4

NAME

6       s_server - SSL/TLS server program
7

SYNOPSIS

9       openssl s_server [-accept port] [-context id] [-verify depth] [-Verify
10       depth] [-crl_check] [-crl_check_all] [-cert filename] [-certform
11       DER|PEM] [-key keyfile] [-keyform DER|PEM] [-pass arg] [-dcert
12       filename] [-dcertform DER|PEM] [-dkey keyfile] [-dkeyform DER|PEM]
13       [-dpass arg] [-dhparam filename] [-nbio] [-nbio_test] [-crlf] [-debug]
14       [-msg] [-state] [-CApath directory] [-CAfile filename] [-nocert]
15       [-cipher cipherlist] [-quiet] [-no_tmp_rsa] [-ssl2] [-ssl3] [-tls1]
16       [-no_ssl2] [-no_ssl3] [-no_tls1] [-no_dhe] [-bugs] [-hack] [-www]
17       [-WWW] [-HTTP] [-engine id] [-tlsextdebug] [-no_ticket] [-id_prefix
18       arg] [-rand file(s)]
19

DESCRIPTION

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

OPTIONS

25       -accept port
26           the TCP port to listen on for connections. If not specified 4433 is
27           used.
28
29       -context id
30           sets the SSL context id. It can be given any string value. If this
31           option is not present a default value will be used.
32
33       -cert certname
34           The certificate to use, most servers cipher suites require the use
35           of a certificate and some require a certificate with a certain
36           public key type: for example the DSS cipher suites require a
37           certificate containing a DSS (DSA) key. If not specified then the
38           filename "server.pem" will be used.
39
40       -certform format
41           The certificate format to use: DER or PEM. PEM is the default.
42
43       -key keyfile
44           The private key to use. If not specified then the certificate file
45           will be used.
46
47       -keyform format
48           The private format to use: DER or PEM. PEM is the default.
49
50       -pass arg
51           the private key password source. For more information about the
52           format of arg see the PASS PHRASE ARGUMENTS section in openssl(1).
53
54       -dcert filename, -dkey keyname
55           specify an additional certificate and private key, these behave in
56           the same manner as the -cert and -key options except there is no
57           default if they are not specified (no additional certificate and
58           key is used). As noted above some cipher suites require a
59           certificate containing a key of a certain type. Some cipher suites
60           need a certificate carrying an RSA key and some a DSS (DSA) key. By
61           using RSA and DSS certificates and keys a server can support
62           clients which only support RSA or DSS cipher suites by using an
63           appropriate certificate.
64
65       -dcertform format, -dkeyform format, -dpass arg
66           addtional certificate and private key format and passphrase
67           respectively.
68
69       -nocert
70           if this option is set then no certificate is used. This restricts
71           the cipher suites available to the anonymous ones (currently just
72           anonymous DH).
73
74       -dhparam filename
75           the DH parameter file to use. The ephemeral DH cipher suites
76           generate keys using a set of DH parameters. If not specified then
77           an attempt is made to load the parameters from the server
78           certificate file. If this fails then a static set of parameters
79           hard coded into the s_server program will be used.
80
81       -no_dhe
82           if this option is set then no DH parameters will be loaded
83           effectively disabling the ephemeral DH cipher suites.
84
85       -no_tmp_rsa
86           certain export cipher suites sometimes use a temporary RSA key,
87           this option disables temporary RSA key generation.
88
89       -verify depth, -Verify depth
90           The verify depth to use. This specifies the maximum length of the
91           client certificate chain and makes the server request a certificate
92           from the client. With the -verify option a certificate is requested
93           but the client does not have to send one, with the -Verify option
94           the client must supply a certificate or an error occurs.
95
96       -crl_check, -crl_check_all
97           Check the peer certificate has not been revoked by its CA.  The
98           CRL(s) are appended to the certificate file. With the
99           -crl_check_all option all CRLs of all CAs in the chain are checked.
100
101       -CApath directory
102           The directory to use for client certificate verification. This
103           directory must be in "hash format", see verify for more
104           information. These are also used when building the server
105           certificate chain.
106
107       -CAfile file
108           A file containing trusted certificates to use during client
109           authentication and to use when attempting to build the server
110           certificate chain. The list is also used in the list of acceptable
111           client CAs passed to the client when a certificate is requested.
112
113       -state
114           prints out the SSL session states.
115
116       -debug
117           print extensive debugging information including a hex dump of all
118           traffic.
119
120       -msg
121           show all protocol messages with hex dump.
122
123       -nbio_test
124           tests non blocking I/O
125
126       -nbio
127           turns on non blocking I/O
128
129       -crlf
130           this option translated a line feed from the terminal into CR+LF.
131
132       -quiet
133           inhibit printing of session and certificate information.
134
135       -psk_hint hint
136           Use the PSK identity hint hint when using a PSK cipher suite.
137
138       -psk key
139           Use the PSK key key when using a PSK cipher suite. The key is given
140           as a hexadecimal number without leading 0x, for example -psk
141           1a2b3c4d.
142
143       -ssl2, -ssl3, -tls1, -no_ssl2, -no_ssl3, -no_tls1
144           these options disable the use of certain SSL or TLS protocols. By
145           default the initial handshake uses a method which should be
146           compatible with all servers and permit them to use SSL v3, SSL v2
147           or TLS as appropriate.
148
149       -bugs
150           there are several known bug in SSL and TLS implementations. Adding
151           this option enables various workarounds.
152
153       -hack
154           this option enables a further workaround for some some early
155           Netscape SSL code (?).
156
157       -cipher cipherlist
158           this allows the cipher list used by the server to be modified.
159           When the client sends a list of supported ciphers the first client
160           cipher also included in the server list is used. Because the client
161           specifies the preference order, the order of the server cipherlist
162           irrelevant. See the ciphers command for more information.
163
164       -tlsextdebug
165           print out a hex dump of any TLS extensions received from the
166           server.
167
168       -no_ticket
169           disable RFC4507bis session ticket support.
170
171       -www
172           sends a status message back to the client when it connects. This
173           includes lots of information about the ciphers used and various
174           session parameters.  The output is in HTML format so this option
175           will normally be used with a web browser.
176
177       -WWW
178           emulates a simple web server. Pages will be resolved relative to
179           the current directory, for example if the URL
180           https://myhost/page.html is requested the file ./page.html will be
181           loaded.
182
183       -HTTP
184           emulates a simple web server. Pages will be resolved relative to
185           the current directory, for example if the URL
186           https://myhost/page.html is requested the file ./page.html will be
187           loaded. The files loaded are assumed to contain a complete and
188           correct HTTP response (lines that are part of the HTTP response
189           line and headers must end with CRLF).
190
191       -engine id
192           specifying an engine (by its unique id string) will cause s_server
193           to attempt to obtain a functional reference to the specified
194           engine, thus initialising it if needed. The engine will then be set
195           as the default for all available algorithms.
196
197       -id_prefix arg
198           generate SSL/TLS session IDs prefixed by arg. This is mostly useful
199           for testing any SSL/TLS code (eg. proxies) that wish to deal with
200           multiple servers, when each of which might be generating a unique
201           range of session IDs (eg. with a certain prefix).
202
203       -rand file(s)
204           a file or files containing random data used to seed the random
205           number generator, or an EGD socket (see RAND_egd(3)).  Multiple
206           files can be specified separated by a OS-dependent character.  The
207           separator is ; for MS-Windows, , for OpenVMS, and : for all others.
208

CONNECTED COMMANDS

210       If a connection request is established with an SSL client and neither
211       the -www nor the -WWW option has been used then normally any data
212       received from the client is displayed and any key presses will be sent
213       to the client.
214
215       Certain single letter commands are also recognized which perform
216       special operations: these are listed below.
217
218       q   end the current SSL connection but still accept new connections.
219
220       Q   end the current SSL connection and exit.
221
222       r   renegotiate the SSL session.
223
224       R   renegotiate the SSL session and request a client certificate.
225
226       P   send some plain text down the underlying TCP connection: this
227           should cause the client to disconnect due to a protocol violation.
228
229       S   print out some session cache status information.
230

NOTES

232       s_server can be used to debug SSL clients. To accept connections from a
233       web browser the command:
234
235        openssl s_server -accept 443 -www
236
237       can be used for example.
238
239       Most web browsers (in particular Netscape and MSIE) only support RSA
240       cipher suites, so they cannot connect to servers which don't use a
241       certificate carrying an RSA key or a version of OpenSSL with RSA
242       disabled.
243
244       Although specifying an empty list of CAs when requesting a client
245       certificate is strictly speaking a protocol violation, some SSL clients
246       interpret this to mean any CA is acceptable. This is useful for
247       debugging purposes.
248
249       The session parameters can printed out using the sess_id program.
250

BUGS

252       Because this program has a lot of options and also because some of the
253       techniques used are rather old, the C source of s_server is rather hard
254       to read and not a model of how things should be done. A typical SSL
255       server program would be much simpler.
256
257       The output of common ciphers is wrong: it just gives the list of
258       ciphers that OpenSSL recognizes and the client supports.
259
260       There should be a way for the s_server program to print out details of
261       any unknown cipher suites a client says it supports.
262

SEE ALSO

264       sess_id(1), s_client(1), ciphers(1)
265
266
267
2681.0.0e                            2009-04-10                       S_SERVER(1)
Impressum