1 .\" $NetBSD: openssl_s_server.1,v 1.14 2015/06/12 17:01:15 christos Exp $
3 .\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
6 .\" ========================================================================
7 .de Sp \" Vertical space (when we can't use .PP)
11 .de Vb \" Begin verbatim text
16 .de Ve \" End verbatim text
20 .\" Set up some character translations and predefined strings. \*(-- will
21 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
22 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
23 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
24 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
25 .\" nothing in troff, for use with C<>.
27 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
31 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
32 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
47 .\" Escape single quotes in literal strings from groff's Unicode transform.
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
53 .\" entries marked with X<> in POD. Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
56 .\" Avoid warning from groff about undefined register 'F'.
60 .if \n(.g .if rF .nr rF 1
61 .if (\n(rF:(\n(.g==0)) \{
64 . tm Index:\\$1\t\\n%\t"\\$2"
74 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
75 .\" Fear. Run. Save yourself. No user-serviceable parts.
76 . \" fudge factors for nroff and troff
85 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
91 . \" simple accents for nroff and troff
101 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
102 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
103 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
104 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
105 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
106 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
108 . \" troff and (daisy-wheel) nroff accents
109 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
110 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
111 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
112 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
113 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
114 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
115 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
116 .ds ae a\h'-(\w'a'u*4/10)'e
117 .ds Ae A\h'-(\w'A'u*4/10)'E
118 . \" corrections for vroff
119 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
120 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
121 . \" for low resolution devices (crt and lpr)
122 .if \n(.H>23 .if \n(.V>19 \
135 .\" ========================================================================
137 .IX Title "S_SERVER 1"
138 .TH S_SERVER 1 "2015-06-12" "1.0.1n" "OpenSSL"
139 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
140 .\" way too many mistakes in technical documents.
144 s_server \- SSL/TLS server program
148 .IX Header "SYNOPSIS"
149 \&\fBopenssl\fR \fBs_server\fR
150 [\fB\-accept port\fR]
152 [\fB\-verify depth\fR]
153 [\fB\-Verify depth\fR]
155 [\fB\-crl_check_all\fR]
156 [\fB\-cert filename\fR]
157 [\fB\-certform DER|PEM\fR]
158 [\fB\-key keyfile\fR]
159 [\fB\-keyform DER|PEM\fR]
161 [\fB\-dcert filename\fR]
162 [\fB\-dcertform DER|PEM\fR]
163 [\fB\-dkey keyfile\fR]
164 [\fB\-dkeyform DER|PEM\fR]
166 [\fB\-dhparam filename\fR]
173 [\fB\-CApath directory\fR]
174 [\fB\-CAfile filename\fR]
175 [\fB\-no_alt_chains\fR]
177 [\fB\-cipher cipherlist\fR]
195 [\fB\-tlsextdebug\fR]
197 [\fB\-id_prefix arg\fR]
198 [\fB\-rand file(s)\fR]
200 [\fB\-status_verbose\fR]
201 [\fB\-status_timeout nsec\fR]
202 [\fB\-status_url url\fR]
203 [\fB\-nextprotoneg protocols\fR]
205 .IX Header "DESCRIPTION"
206 The \fBs_server\fR command implements a generic \s-1SSL/TLS\s0 server which listens
207 for connections on a given port using \s-1SSL/TLS.\s0
210 .IP "\fB\-accept port\fR" 4
211 .IX Item "-accept port"
212 the \s-1TCP\s0 port to listen on for connections. If not specified 4433 is used.
213 .IP "\fB\-context id\fR" 4
214 .IX Item "-context id"
215 sets the \s-1SSL\s0 context id. It can be given any string value. If this option
216 is not present a default value will be used.
217 .IP "\fB\-cert certname\fR" 4
218 .IX Item "-cert certname"
219 The certificate to use, most servers cipher suites require the use of a
220 certificate and some require a certificate with a certain public key type:
221 for example the \s-1DSS\s0 cipher suites require a certificate containing a \s-1DSS
222 \&\s0(\s-1DSA\s0) key. If not specified then the filename \*(L"server.pem\*(R" will be used.
223 .IP "\fB\-certform format\fR" 4
224 .IX Item "-certform format"
225 The certificate format to use: \s-1DER\s0 or \s-1PEM. PEM\s0 is the default.
226 .IP "\fB\-key keyfile\fR" 4
227 .IX Item "-key keyfile"
228 The private key to use. If not specified then the certificate file will
230 .IP "\fB\-keyform format\fR" 4
231 .IX Item "-keyform format"
232 The private format to use: \s-1DER\s0 or \s-1PEM. PEM\s0 is the default.
233 .IP "\fB\-pass arg\fR" 4
235 the private key password source. For more information about the format of \fBarg\fR
236 see the \fB\s-1PASS PHRASE ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1).
237 .IP "\fB\-dcert filename\fR, \fB\-dkey keyname\fR" 4
238 .IX Item "-dcert filename, -dkey keyname"
239 specify an additional certificate and private key, these behave in the
240 same manner as the \fB\-cert\fR and \fB\-key\fR options except there is no default
241 if they are not specified (no additional certificate and key is used). As
242 noted above some cipher suites require a certificate containing a key of
243 a certain type. Some cipher suites need a certificate carrying an \s-1RSA\s0 key
244 and some a \s-1DSS \s0(\s-1DSA\s0) key. By using \s-1RSA\s0 and \s-1DSS\s0 certificates and keys
245 a server can support clients which only support \s-1RSA\s0 or \s-1DSS\s0 cipher suites
246 by using an appropriate certificate.
247 .IP "\fB\-dcertform format\fR, \fB\-dkeyform format\fR, \fB\-dpass arg\fR" 4
248 .IX Item "-dcertform format, -dkeyform format, -dpass arg"
249 additional certificate and private key format and passphrase respectively.
250 .IP "\fB\-nocert\fR" 4
252 if this option is set then no certificate is used. This restricts the
253 cipher suites available to the anonymous ones (currently just anonymous
255 .IP "\fB\-dhparam filename\fR" 4
256 .IX Item "-dhparam filename"
257 the \s-1DH\s0 parameter file to use. The ephemeral \s-1DH\s0 cipher suites generate keys
258 using a set of \s-1DH\s0 parameters. If not specified then an attempt is made to
259 load the parameters from the server certificate file. If this fails then
260 a static set of parameters hard coded into the s_server program will be used.
261 .IP "\fB\-no_dhe\fR" 4
263 if this option is set then no \s-1DH\s0 parameters will be loaded effectively
264 disabling the ephemeral \s-1DH\s0 cipher suites.
265 .IP "\fB\-no_ecdhe\fR" 4
267 if this option is set then no \s-1ECDH\s0 parameters will be loaded effectively
268 disabling the ephemeral \s-1ECDH\s0 cipher suites.
269 .IP "\fB\-no_tmp_rsa\fR" 4
270 .IX Item "-no_tmp_rsa"
271 certain export cipher suites sometimes use a temporary \s-1RSA\s0 key, this option
272 disables temporary \s-1RSA\s0 key generation.
273 .IP "\fB\-verify depth\fR, \fB\-Verify depth\fR" 4
274 .IX Item "-verify depth, -Verify depth"
275 The verify depth to use. This specifies the maximum length of the
276 client certificate chain and makes the server request a certificate from
277 the client. With the \fB\-verify\fR option a certificate is requested but the
278 client does not have to send one, with the \fB\-Verify\fR option the client
279 must supply a certificate or an error occurs.
281 If the ciphersuite cannot request a client certificate (for example an
282 anonymous ciphersuite or \s-1PSK\s0) this option has no effect.
283 .IP "\fB\-crl_check\fR, \fB\-crl_check_all\fR" 4
284 .IX Item "-crl_check, -crl_check_all"
285 Check the peer certificate has not been revoked by its \s-1CA.\s0
286 The \s-1CRL\s0(s) are appended to the certificate file. With the \fB\-crl_check_all\fR
287 option all CRLs of all CAs in the chain are checked.
288 .IP "\fB\-CApath directory\fR" 4
289 .IX Item "-CApath directory"
290 The directory to use for client certificate verification. This directory
291 must be in \*(L"hash format\*(R", see \fBverify\fR for more information. These are
292 also used when building the server certificate chain.
293 .IP "\fB\-CAfile file\fR" 4
294 .IX Item "-CAfile file"
295 A file containing trusted certificates to use during client authentication
296 and to use when attempting to build the server certificate chain. The list
297 is also used in the list of acceptable client CAs passed to the client when
298 a certificate is requested.
299 .IP "\fB\-no_alt_chains\fR" 4
300 .IX Item "-no_alt_chains"
301 See the \fBverify\fR manual page for details.
302 .IP "\fB\-state\fR" 4
304 prints out the \s-1SSL\s0 session states.
305 .IP "\fB\-debug\fR" 4
307 print extensive debugging information including a hex dump of all traffic.
310 show all protocol messages with hex dump.
311 .IP "\fB\-nbio_test\fR" 4
312 .IX Item "-nbio_test"
313 tests non blocking I/O
316 turns on non blocking I/O
319 this option translated a line feed from the terminal into \s-1CR+LF.\s0
320 .IP "\fB\-quiet\fR" 4
322 inhibit printing of session and certificate information.
323 .IP "\fB\-psk_hint hint\fR" 4
324 .IX Item "-psk_hint hint"
325 Use the \s-1PSK\s0 identity hint \fBhint\fR when using a \s-1PSK\s0 cipher suite.
326 .IP "\fB\-psk key\fR" 4
328 Use the \s-1PSK\s0 key \fBkey\fR when using a \s-1PSK\s0 cipher suite. The key is
329 given as a hexadecimal number without leading 0x, for example \-psk
331 .IP "\fB\-ssl2\fR, \fB\-ssl3\fR, \fB\-tls1\fR, \fB\-no_ssl2\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR" 4
332 .IX Item "-ssl2, -ssl3, -tls1, -no_ssl2, -no_ssl3, -no_tls1"
333 these options disable the use of certain \s-1SSL\s0 or \s-1TLS\s0 protocols. By default
334 the initial handshake uses a method which should be compatible with all
335 servers and permit them to use \s-1SSL\s0 v3, \s-1SSL\s0 v2 or \s-1TLS\s0 as appropriate.
338 there are several known bug in \s-1SSL\s0 and \s-1TLS\s0 implementations. Adding this
339 option enables various workarounds.
342 this option enables a further workaround for some some early Netscape
343 \&\s-1SSL\s0 code (?).
344 .IP "\fB\-cipher cipherlist\fR" 4
345 .IX Item "-cipher cipherlist"
346 this allows the cipher list used by the server to be modified. When
347 the client sends a list of supported ciphers the first client cipher
348 also included in the server list is used. Because the client specifies
349 the preference order, the order of the server cipherlist irrelevant. See
350 the \fBciphers\fR command for more information.
351 .IP "\fB\-serverpref\fR" 4
352 .IX Item "-serverpref"
353 use the server's cipher preferences, rather than the client's preferences.
354 .IP "\fB\-tlsextdebug\fR" 4
355 .IX Item "-tlsextdebug"
356 print out a hex dump of any \s-1TLS\s0 extensions received from the server.
357 .IP "\fB\-no_ticket\fR" 4
358 .IX Item "-no_ticket"
359 disable RFC4507bis session ticket support.
362 sends a status message back to the client when it connects. This includes
363 lots of information about the ciphers used and various session parameters.
364 The output is in \s-1HTML\s0 format so this option will normally be used with a
368 emulates a simple web server. Pages will be resolved relative to the
369 current directory, for example if the \s-1URL\s0 https://myhost/page.html is
370 requested the file ./page.html will be loaded.
373 emulates a simple web server. Pages will be resolved relative to the
374 current directory, for example if the \s-1URL\s0 https://myhost/page.html is
375 requested the file ./page.html will be loaded. The files loaded are
376 assumed to contain a complete and correct \s-1HTTP\s0 response (lines that
377 are part of the \s-1HTTP\s0 response line and headers must end with \s-1CRLF\s0).
378 .IP "\fB\-engine id\fR" 4
379 .IX Item "-engine id"
380 specifying an engine (by its unique \fBid\fR string) will cause \fBs_server\fR
381 to attempt to obtain a functional reference to the specified engine,
382 thus initialising it if needed. The engine will then be set as the default
383 for all available algorithms.
384 .IP "\fB\-id_prefix arg\fR" 4
385 .IX Item "-id_prefix arg"
386 generate \s-1SSL/TLS\s0 session IDs prefixed by \fBarg\fR. This is mostly useful
387 for testing any \s-1SSL/TLS\s0 code (eg. proxies) that wish to deal with multiple
388 servers, when each of which might be generating a unique range of session
389 IDs (eg. with a certain prefix).
390 .IP "\fB\-rand file(s)\fR" 4
391 .IX Item "-rand file(s)"
392 a file or files containing random data used to seed the random number
393 generator, or an \s-1EGD\s0 socket (see \fIRAND_egd\fR\|(3)).
394 Multiple files can be specified separated by a OS-dependent character.
395 The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
397 .IP "\fB\-status\fR" 4
399 enables certificate status request support (aka \s-1OCSP\s0 stapling).
400 .IP "\fB\-status_verbose\fR" 4
401 .IX Item "-status_verbose"
402 enables certificate status request support (aka \s-1OCSP\s0 stapling) and gives
403 a verbose printout of the \s-1OCSP\s0 response.
404 .IP "\fB\-status_timeout nsec\fR" 4
405 .IX Item "-status_timeout nsec"
406 sets the timeout for \s-1OCSP\s0 response to \fBnsec\fR seconds.
407 .IP "\fB\-status_url url\fR" 4
408 .IX Item "-status_url url"
409 sets a fallback responder \s-1URL\s0 to use if no responder \s-1URL\s0 is present in the
410 server certificate. Without this option an error is returned if the server
411 certificate does not contain a responder address.
412 .IP "\fB\-nextprotoneg protocols\fR" 4
413 .IX Item "-nextprotoneg protocols"
414 enable Next Protocol Negotiation \s-1TLS\s0 extension and provide a
415 comma-separated list of supported protocol names.
416 The list should contain most wanted protocols first.
417 Protocol names are printable \s-1ASCII\s0 strings, for example \*(L"http/1.1\*(R" or
419 .SH "CONNECTED COMMANDS"
420 .IX Header "CONNECTED COMMANDS"
421 If a connection request is established with an \s-1SSL\s0 client and neither the
422 \&\fB\-www\fR nor the \fB\-WWW\fR option has been used then normally any data received
423 from the client is displayed and any key presses will be sent to the client.
425 Certain single letter commands are also recognized which perform special
426 operations: these are listed below.
429 end the current \s-1SSL\s0 connection but still accept new connections.
432 end the current \s-1SSL\s0 connection and exit.
435 renegotiate the \s-1SSL\s0 session.
438 renegotiate the \s-1SSL\s0 session and request a client certificate.
441 send some plain text down the underlying \s-1TCP\s0 connection: this should
442 cause the client to disconnect due to a protocol violation.
445 print out some session cache status information.
448 \&\fBs_server\fR can be used to debug \s-1SSL\s0 clients. To accept connections from
449 a web browser the command:
452 \& openssl s_server \-accept 443 \-www
455 can be used for example.
457 Most web browsers (in particular Netscape and \s-1MSIE\s0) only support \s-1RSA\s0 cipher
458 suites, so they cannot connect to servers which don't use a certificate
459 carrying an \s-1RSA\s0 key or a version of OpenSSL with \s-1RSA\s0 disabled.
461 Although specifying an empty list of CAs when requesting a client certificate
462 is strictly speaking a protocol violation, some \s-1SSL\s0 clients interpret this to
463 mean any \s-1CA\s0 is acceptable. This is useful for debugging purposes.
465 The session parameters can printed out using the \fBsess_id\fR program.
468 Because this program has a lot of options and also because some of
469 the techniques used are rather old, the C source of s_server is rather
470 hard to read and not a model of how things should be done. A typical
471 \&\s-1SSL\s0 server program would be much simpler.
473 The output of common ciphers is wrong: it just gives the list of ciphers that
474 OpenSSL recognizes and the client supports.
476 There should be a way for the \fBs_server\fR program to print out details of any
477 unknown cipher suites a client says it supports.
479 .IX Header "SEE ALSO"
480 \&\fIopenssl_sess_id\fR\|(1), \fIopenssl_s_client\fR\|(1), \fIopenssl_ciphers\fR\|(1)
483 The \-no_alt_chains options was first added to OpenSSL 1.0.1n and 1.0.2b.