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