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