]> CyberLeo.Net >> Repos - FreeBSD/releng/9.3.git/blob - secure/usr.bin/openssl/man/s_server.1
Fix multiple OpenSSL vulnerabilities.
[FreeBSD/releng/9.3.git] / secure / usr.bin / openssl / man / s_server.1
1 .\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is turned on, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .nr rF 0
58 .if \n(.g .if rF .nr rF 1
59 .if (\n(rF:(\n(.g==0)) \{
60 .    if \nF \{
61 .        de IX
62 .        tm Index:\\$1\t\\n%\t"\\$2"
63 ..
64 .        if !\nF==2 \{
65 .            nr % 0
66 .            nr F 2
67 .        \}
68 .    \}
69 .\}
70 .rr rF
71 .\"
72 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
73 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
74 .    \" fudge factors for nroff and troff
75 .if n \{\
76 .    ds #H 0
77 .    ds #V .8m
78 .    ds #F .3m
79 .    ds #[ \f1
80 .    ds #] \fP
81 .\}
82 .if t \{\
83 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
84 .    ds #V .6m
85 .    ds #F 0
86 .    ds #[ \&
87 .    ds #] \&
88 .\}
89 .    \" simple accents for nroff and troff
90 .if n \{\
91 .    ds ' \&
92 .    ds ` \&
93 .    ds ^ \&
94 .    ds , \&
95 .    ds ~ ~
96 .    ds /
97 .\}
98 .if t \{\
99 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
100 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
101 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
102 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
103 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
104 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
105 .\}
106 .    \" troff and (daisy-wheel) nroff accents
107 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
108 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
109 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
110 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
111 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
112 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
113 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
114 .ds ae a\h'-(\w'a'u*4/10)'e
115 .ds Ae A\h'-(\w'A'u*4/10)'E
116 .    \" corrections for vroff
117 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
118 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
119 .    \" for low resolution devices (crt and lpr)
120 .if \n(.H>23 .if \n(.V>19 \
121 \{\
122 .    ds : e
123 .    ds 8 ss
124 .    ds o a
125 .    ds d- d\h'-1'\(ga
126 .    ds D- D\h'-1'\(hy
127 .    ds th \o'bp'
128 .    ds Th \o'LP'
129 .    ds ae ae
130 .    ds Ae AE
131 .\}
132 .rm #[ #] #H #V #F C
133 .\" ========================================================================
134 .\"
135 .IX Title "S_SERVER 1"
136 .TH S_SERVER 1 "2015-12-03" "0.9.8zh" "OpenSSL"
137 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
138 .\" way too many mistakes in technical documents.
139 .if n .ad l
140 .nh
141 .SH "NAME"
142 s_server \- SSL/TLS server program
143 .SH "SYNOPSIS"
144 .IX Header "SYNOPSIS"
145 \&\fBopenssl\fR \fBs_server\fR
146 [\fB\-accept port\fR]
147 [\fB\-context id\fR]
148 [\fB\-verify depth\fR]
149 [\fB\-Verify depth\fR]
150 [\fB\-crl_check\fR]
151 [\fB\-crl_check_all\fR]
152 [\fB\-cert filename\fR]
153 [\fB\-certform DER|PEM\fR]
154 [\fB\-key keyfile\fR]
155 [\fB\-keyform DER|PEM\fR]
156 [\fB\-pass arg\fR]
157 [\fB\-dcert filename\fR]
158 [\fB\-dcertform DER|PEM\fR]
159 [\fB\-dkey keyfile\fR]
160 [\fB\-dkeyform DER|PEM\fR]
161 [\fB\-dpass arg\fR]
162 [\fB\-dhparam filename\fR]
163 [\fB\-nbio\fR]
164 [\fB\-nbio_test\fR]
165 [\fB\-crlf\fR]
166 [\fB\-debug\fR]
167 [\fB\-msg\fR]
168 [\fB\-state\fR]
169 [\fB\-CApath directory\fR]
170 [\fB\-CAfile filename\fR]
171 [\fB\-nocert\fR]
172 [\fB\-cipher cipherlist\fR]
173 [\fB\-serverpref\fR]
174 [\fB\-quiet\fR]
175 [\fB\-no_tmp_rsa\fR]
176 [\fB\-ssl2\fR]
177 [\fB\-ssl3\fR]
178 [\fB\-tls1\fR]
179 [\fB\-no_ssl2\fR]
180 [\fB\-no_ssl3\fR]
181 [\fB\-no_tls1\fR]
182 [\fB\-no_dhe\fR]
183 [\fB\-bugs\fR]
184 [\fB\-hack\fR]
185 [\fB\-www\fR]
186 [\fB\-WWW\fR]
187 [\fB\-HTTP\fR]
188 [\fB\-engine id\fR]
189 [\fB\-tlsextdebug\fR]
190 [\fB\-no_ticket\fR]
191 [\fB\-id_prefix arg\fR]
192 [\fB\-rand file(s)\fR]
193 .SH "DESCRIPTION"
194 .IX Header "DESCRIPTION"
195 The \fBs_server\fR command implements a generic \s-1SSL/TLS\s0 server which listens
196 for connections on a given port using \s-1SSL/TLS.\s0
197 .SH "OPTIONS"
198 .IX Header "OPTIONS"
199 .IP "\fB\-accept port\fR" 4
200 .IX Item "-accept port"
201 the \s-1TCP\s0 port to listen on for connections. If not specified 4433 is used.
202 .IP "\fB\-context id\fR" 4
203 .IX Item "-context id"
204 sets the \s-1SSL\s0 context id. It can be given any string value. If this option
205 is not present a default value will be used.
206 .IP "\fB\-cert certname\fR" 4
207 .IX Item "-cert certname"
208 The certificate to use, most servers cipher suites require the use of a
209 certificate and some require a certificate with a certain public key type:
210 for example the \s-1DSS\s0 cipher suites require a certificate containing a \s-1DSS
211 \&\s0(\s-1DSA\s0) key. If not specified then the filename \*(L"server.pem\*(R" will be used.
212 .IP "\fB\-certform format\fR" 4
213 .IX Item "-certform format"
214 The certificate format to use: \s-1DER\s0 or \s-1PEM. PEM\s0 is the default.
215 .IP "\fB\-key keyfile\fR" 4
216 .IX Item "-key keyfile"
217 The private key to use. If not specified then the certificate file will
218 be used.
219 .IP "\fB\-keyform format\fR" 4
220 .IX Item "-keyform format"
221 The private format to use: \s-1DER\s0 or \s-1PEM. PEM\s0 is the default.
222 .IP "\fB\-pass arg\fR" 4
223 .IX Item "-pass arg"
224 the private key password source. For more information about the format of \fBarg\fR
225 see the \fB\s-1PASS PHRASE ARGUMENTS\s0\fR section in \fIopenssl\fR\|(1).
226 .IP "\fB\-dcert filename\fR, \fB\-dkey keyname\fR" 4
227 .IX Item "-dcert filename, -dkey keyname"
228 specify an additional certificate and private key, these behave in the
229 same manner as the \fB\-cert\fR and \fB\-key\fR options except there is no default
230 if they are not specified (no additional certificate and key is used). As
231 noted above some cipher suites require a certificate containing a key of
232 a certain type. Some cipher suites need a certificate carrying an \s-1RSA\s0 key
233 and some a \s-1DSS \s0(\s-1DSA\s0) key. By using \s-1RSA\s0 and \s-1DSS\s0 certificates and keys
234 a server can support clients which only support \s-1RSA\s0 or \s-1DSS\s0 cipher suites
235 by using an appropriate certificate.
236 .IP "\fB\-dcertform format\fR, \fB\-dkeyform format\fR, \fB\-dpass arg\fR" 4
237 .IX Item "-dcertform format, -dkeyform format, -dpass arg"
238 addtional certificate and private key format and passphrase respectively.
239 .IP "\fB\-nocert\fR" 4
240 .IX Item "-nocert"
241 if this option is set then no certificate is used. This restricts the
242 cipher suites available to the anonymous ones (currently just anonymous
243 \&\s-1DH\s0).
244 .IP "\fB\-dhparam filename\fR" 4
245 .IX Item "-dhparam filename"
246 the \s-1DH\s0 parameter file to use. The ephemeral \s-1DH\s0 cipher suites generate keys
247 using a set of \s-1DH\s0 parameters. If not specified then an attempt is made to
248 load the parameters from the server certificate file. If this fails then
249 a static set of parameters hard coded into the s_server program will be used.
250 .IP "\fB\-no_dhe\fR" 4
251 .IX Item "-no_dhe"
252 if this option is set then no \s-1DH\s0 parameters will be loaded effectively
253 disabling the ephemeral \s-1DH\s0 cipher suites.
254 .IP "\fB\-no_tmp_rsa\fR" 4
255 .IX Item "-no_tmp_rsa"
256 certain export cipher suites sometimes use a temporary \s-1RSA\s0 key, this option
257 disables temporary \s-1RSA\s0 key generation.
258 .IP "\fB\-verify depth\fR, \fB\-Verify depth\fR" 4
259 .IX Item "-verify depth, -Verify depth"
260 The verify depth to use. This specifies the maximum length of the
261 client certificate chain and makes the server request a certificate from
262 the client. With the \fB\-verify\fR option a certificate is requested but the
263 client does not have to send one, with the \fB\-Verify\fR option the client
264 must supply a certificate or an error occurs.
265 .Sp
266 If the ciphersuite cannot request a client certificate (for example an
267 anonymous ciphersuite or \s-1PSK\s0) this option has no effect.
268 .IP "\fB\-crl_check\fR, \fB\-crl_check_all\fR" 4
269 .IX Item "-crl_check, -crl_check_all"
270 Check the peer certificate has not been revoked by its \s-1CA.\s0
271 The \s-1CRL\s0(s) are appended to the certificate file. With the \fB\-crl_check_all\fR
272 option all CRLs of all CAs in the chain are checked.
273 .IP "\fB\-CApath directory\fR" 4
274 .IX Item "-CApath directory"
275 The directory to use for client certificate verification. This directory
276 must be in \*(L"hash format\*(R", see \fBverify\fR for more information. These are
277 also used when building the server certificate chain.
278 .IP "\fB\-CAfile file\fR" 4
279 .IX Item "-CAfile file"
280 A file containing trusted certificates to use during client authentication
281 and to use when attempting to build the server certificate chain. The list
282 is also used in the list of acceptable client CAs passed to the client when
283 a certificate is requested.
284 .IP "\fB\-state\fR" 4
285 .IX Item "-state"
286 prints out the \s-1SSL\s0 session states.
287 .IP "\fB\-debug\fR" 4
288 .IX Item "-debug"
289 print extensive debugging information including a hex dump of all traffic.
290 .IP "\fB\-msg\fR" 4
291 .IX Item "-msg"
292 show all protocol messages with hex dump.
293 .IP "\fB\-nbio_test\fR" 4
294 .IX Item "-nbio_test"
295 tests non blocking I/O
296 .IP "\fB\-nbio\fR" 4
297 .IX Item "-nbio"
298 turns on non blocking I/O
299 .IP "\fB\-crlf\fR" 4
300 .IX Item "-crlf"
301 this option translated a line feed from the terminal into \s-1CR+LF.\s0
302 .IP "\fB\-quiet\fR" 4
303 .IX Item "-quiet"
304 inhibit printing of session and certificate information.
305 .IP "\fB\-ssl2\fR, \fB\-ssl3\fR, \fB\-tls1\fR, \fB\-no_ssl2\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR" 4
306 .IX Item "-ssl2, -ssl3, -tls1, -no_ssl2, -no_ssl3, -no_tls1"
307 these options disable the use of certain \s-1SSL\s0 or \s-1TLS\s0 protocols. By default
308 the initial handshake uses a method which should be compatible with all
309 servers and permit them to use \s-1SSL\s0 v3, \s-1SSL\s0 v2 or \s-1TLS\s0 as appropriate.
310 .IP "\fB\-bugs\fR" 4
311 .IX Item "-bugs"
312 there are several known bug in \s-1SSL\s0 and \s-1TLS\s0 implementations. Adding this
313 option enables various workarounds.
314 .IP "\fB\-hack\fR" 4
315 .IX Item "-hack"
316 this option enables a further workaround for some some early Netscape
317 \&\s-1SSL\s0 code (?).
318 .IP "\fB\-cipher cipherlist\fR" 4
319 .IX Item "-cipher cipherlist"
320 this allows the cipher list used by the server to be modified.  When
321 the client sends a list of supported ciphers the first client cipher
322 also included in the server list is used. Because the client specifies
323 the preference order, the order of the server cipherlist irrelevant. See
324 the \fBciphers\fR command for more information.
325 .IP "\fB\-serverpref\fR" 4
326 .IX Item "-serverpref"
327 use the server's cipher preferences, rather than the client's preferences.
328 .IP "\fB\-tlsextdebug\fR" 4
329 .IX Item "-tlsextdebug"
330 print out a hex dump of any \s-1TLS\s0 extensions received from the server.
331 .IP "\fB\-no_ticket\fR" 4
332 .IX Item "-no_ticket"
333 disable RFC4507bis session ticket support.
334 .IP "\fB\-www\fR" 4
335 .IX Item "-www"
336 sends a status message back to the client when it connects. This includes
337 lots of information about the ciphers used and various session parameters.
338 The output is in \s-1HTML\s0 format so this option will normally be used with a
339 web browser.
340 .IP "\fB\-WWW\fR" 4
341 .IX Item "-WWW"
342 emulates a simple web server. Pages will be resolved relative to the
343 current directory, for example if the \s-1URL\s0 https://myhost/page.html is
344 requested the file ./page.html will be loaded.
345 .IP "\fB\-HTTP\fR" 4
346 .IX Item "-HTTP"
347 emulates a simple web server. Pages will be resolved relative to the
348 current directory, for example if the \s-1URL\s0 https://myhost/page.html is
349 requested the file ./page.html will be loaded. The files loaded are
350 assumed to contain a complete and correct \s-1HTTP\s0 response (lines that
351 are part of the \s-1HTTP\s0 response line and headers must end with \s-1CRLF\s0).
352 .IP "\fB\-engine id\fR" 4
353 .IX Item "-engine id"
354 specifying an engine (by it's unique \fBid\fR string) will cause \fBs_server\fR
355 to attempt to obtain a functional reference to the specified engine,
356 thus initialising it if needed. The engine will then be set as the default
357 for all available algorithms.
358 .IP "\fB\-id_prefix arg\fR" 4
359 .IX Item "-id_prefix arg"
360 generate \s-1SSL/TLS\s0 session IDs prefixed by \fBarg\fR. This is mostly useful
361 for testing any \s-1SSL/TLS\s0 code (eg. proxies) that wish to deal with multiple
362 servers, when each of which might be generating a unique range of session
363 IDs (eg. with a certain prefix).
364 .IP "\fB\-rand file(s)\fR" 4
365 .IX Item "-rand file(s)"
366 a file or files containing random data used to seed the random number
367 generator, or an \s-1EGD\s0 socket (see \fIRAND_egd\fR\|(3)).
368 Multiple files can be specified separated by a OS-dependent character.
369 The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
370 all others.
371 .SH "CONNECTED COMMANDS"
372 .IX Header "CONNECTED COMMANDS"
373 If a connection request is established with an \s-1SSL\s0 client and neither the
374 \&\fB\-www\fR nor the \fB\-WWW\fR option has been used then normally any data received
375 from the client is displayed and any key presses will be sent to the client.
376 .PP
377 Certain single letter commands are also recognized which perform special
378 operations: these are listed below.
379 .IP "\fBq\fR" 4
380 .IX Item "q"
381 end the current \s-1SSL\s0 connection but still accept new connections.
382 .IP "\fBQ\fR" 4
383 .IX Item "Q"
384 end the current \s-1SSL\s0 connection and exit.
385 .IP "\fBr\fR" 4
386 .IX Item "r"
387 renegotiate the \s-1SSL\s0 session.
388 .IP "\fBR\fR" 4
389 .IX Item "R"
390 renegotiate the \s-1SSL\s0 session and request a client certificate.
391 .IP "\fBP\fR" 4
392 .IX Item "P"
393 send some plain text down the underlying \s-1TCP\s0 connection: this should
394 cause the client to disconnect due to a protocol violation.
395 .IP "\fBS\fR" 4
396 .IX Item "S"
397 print out some session cache status information.
398 .SH "NOTES"
399 .IX Header "NOTES"
400 \&\fBs_server\fR can be used to debug \s-1SSL\s0 clients. To accept connections from
401 a web browser the command:
402 .PP
403 .Vb 1
404 \& openssl s_server \-accept 443 \-www
405 .Ve
406 .PP
407 can be used for example.
408 .PP
409 Most web browsers (in particular Netscape and \s-1MSIE\s0) only support \s-1RSA\s0 cipher
410 suites, so they cannot connect to servers which don't use a certificate
411 carrying an \s-1RSA\s0 key or a version of OpenSSL with \s-1RSA\s0 disabled.
412 .PP
413 Although specifying an empty list of CAs when requesting a client certificate
414 is strictly speaking a protocol violation, some \s-1SSL\s0 clients interpret this to
415 mean any \s-1CA\s0 is acceptable. This is useful for debugging purposes.
416 .PP
417 The session parameters can printed out using the \fBsess_id\fR program.
418 .PP
419 \&\s-1TLS\s0 extensions are only supported in OpenSSL 0.9.8 if they are explictly
420 enabled at compile time using for example the \fBenable-tlsext\fR switch.
421 .SH "BUGS"
422 .IX Header "BUGS"
423 Because this program has a lot of options and also because some of
424 the techniques used are rather old, the C source of s_server is rather
425 hard to read and not a model of how things should be done. A typical
426 \&\s-1SSL\s0 server program would be much simpler.
427 .PP
428 The output of common ciphers is wrong: it just gives the list of ciphers that
429 OpenSSL recognizes and the client supports.
430 .PP
431 There should be a way for the \fBs_server\fR program to print out details of any
432 unknown cipher suites a client says it supports.
433 .SH "SEE ALSO"
434 .IX Header "SEE ALSO"
435 \&\fIsess_id\fR\|(1), \fIs_client\fR\|(1), \fIciphers\fR\|(1)