]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/lib/libcrypto/man/s_client.1
This commit was generated by cvs2svn to compensate for changes in r98681,
[FreeBSD/FreeBSD.git] / secure / lib / libcrypto / man / s_client.1
1 .\" Automatically generated by Pod::Man version 1.15
2 .\" Thu May  9 13:14:55 2002
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_CLIENT 1"
141 .TH S_CLIENT 1 "perl v5.6.1" "2001-05-20" "User Contributed Perl Documentation"
142 .UC
143 .SH "NAME"
144 s_client \- \s-1SSL/TLS\s0 client program
145 .SH "SYNOPSIS"
146 .IX Header "SYNOPSIS"
147 \&\fBopenssl\fR \fBs_client\fR
148 [\fB\-connect\fR host:port>]
149 [\fB\-verify depth\fR]
150 [\fB\-cert filename\fR]
151 [\fB\-key filename\fR]
152 [\fB\-CApath directory\fR]
153 [\fB\-CAfile filename\fR]
154 [\fB\-reconnect\fR]
155 [\fB\-pause\fR]
156 [\fB\-showcerts\fR]
157 [\fB\-debug\fR]
158 [\fB\-nbio_test\fR]
159 [\fB\-state\fR]
160 [\fB\-nbio\fR]
161 [\fB\-crlf\fR]
162 [\fB\-ign_eof\fR]
163 [\fB\-quiet\fR]
164 [\fB\-ssl2\fR]
165 [\fB\-ssl3\fR]
166 [\fB\-tls1\fR]
167 [\fB\-no_ssl2\fR]
168 [\fB\-no_ssl3\fR]
169 [\fB\-no_tls1\fR]
170 [\fB\-bugs\fR]
171 [\fB\-cipher cipherlist\fR]
172 [\fB\-rand \f(BIfile\fB\|(s)\fR]
173 .SH "DESCRIPTION"
174 .IX Header "DESCRIPTION"
175 The \fBs_client\fR command implements a generic \s-1SSL/TLS\s0 client which connects
176 to a remote host using \s-1SSL/TLS\s0. It is a \fIvery\fR useful diagnostic tool for
177 \&\s-1SSL\s0 servers.
178 .SH "OPTIONS"
179 .IX Header "OPTIONS"
180 .Ip "\fB\-connect host:port\fR" 4
181 .IX Item "-connect host:port"
182 This specifies the host and optional port to connect to. If not specified
183 then an attempt is made to connect to the local host on port 4433.
184 .Ip "\fB\-cert certname\fR" 4
185 .IX Item "-cert certname"
186 The certificate to use, if one is requested by the server. The default is
187 not to use a certificate.
188 .Ip "\fB\-key keyfile\fR" 4
189 .IX Item "-key keyfile"
190 The private key to use. If not specified then the certificate file will
191 be used.
192 .Ip "\fB\-verify depth\fR" 4
193 .IX Item "-verify depth"
194 The verify depth to use. This specifies the maximum length of the
195 server certificate chain and turns on server certificate verification.
196 Currently the verify operation continues after errors so all the problems
197 with a certificate chain can be seen. As a side effect the connection
198 will never fail due to a server certificate verify failure.
199 .Ip "\fB\-CApath directory\fR" 4
200 .IX Item "-CApath directory"
201 The directory to use for server certificate verification. This directory
202 must be in \*(L"hash format\*(R", see \fBverify\fR for more information. These are
203 also used when building the client certificate chain.
204 .Ip "\fB\-CAfile file\fR" 4
205 .IX Item "-CAfile file"
206 A file containing trusted certificates to use during server authentication
207 and to use when attempting to build the client certificate chain.
208 .Ip "\fB\-reconnect\fR" 4
209 .IX Item "-reconnect"
210 reconnects to the same server 5 times using the same session \s-1ID\s0, this can
211 be used as a test that session caching is working.
212 .Ip "\fB\-pause\fR" 4
213 .IX Item "-pause"
214 pauses 1 second between each read and write call.
215 .Ip "\fB\-showcerts\fR" 4
216 .IX Item "-showcerts"
217 display the whole server certificate chain: normally only the server
218 certificate itself is displayed.
219 .Ip "\fB\-prexit\fR" 4
220 .IX Item "-prexit"
221 print session information when the program exits. This will always attempt
222 to print out information even if the connection fails. Normally information
223 will only be printed out once if the connection succeeds. This option is useful
224 because the cipher in use may be renegotiated or the connection may fail
225 because a client certificate is required or is requested only after an
226 attempt is made to access a certain \s-1URL\s0. Note: the output produced by this
227 option is not always accurate because a connection might never have been
228 established.
229 .Ip "\fB\-state\fR" 4
230 .IX Item "-state"
231 prints out the \s-1SSL\s0 session states.
232 .Ip "\fB\-debug\fR" 4
233 .IX Item "-debug"
234 print extensive debugging information including a hex dump of all traffic.
235 .Ip "\fB\-nbio_test\fR" 4
236 .IX Item "-nbio_test"
237 tests non-blocking I/O
238 .Ip "\fB\-nbio\fR" 4
239 .IX Item "-nbio"
240 turns on non-blocking I/O
241 .Ip "\fB\-crlf\fR" 4
242 .IX Item "-crlf"
243 this option translated a line feed from the terminal into \s-1CR+LF\s0 as required
244 by some servers.
245 .Ip "\fB\-ign_eof\fR" 4
246 .IX Item "-ign_eof"
247 inhibit shutting down the connection when end of file is reached in the
248 input.
249 .Ip "\fB\-quiet\fR" 4
250 .IX Item "-quiet"
251 inhibit printing of session and certificate information.  This implicitely
252 turns on \fB\-ign_eof\fR as well.
253 .Ip "\fB\-ssl2\fR, \fB\-ssl3\fR, \fB\-tls1\fR, \fB\-no_ssl2\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR" 4
254 .IX Item "-ssl2, -ssl3, -tls1, -no_ssl2, -no_ssl3, -no_tls1"
255 these options disable the use of certain \s-1SSL\s0 or \s-1TLS\s0 protocols. By default
256 the initial handshake uses a method which should be compatible with all
257 servers and permit them to use \s-1SSL\s0 v3, \s-1SSL\s0 v2 or \s-1TLS\s0 as appropriate.
258 .Sp
259 Unfortunately there are a lot of ancient and broken servers in use which
260 cannot handle this technique and will fail to connect. Some servers only
261 work if \s-1TLS\s0 is turned off with the \fB\-no_tls\fR option others will only
262 support \s-1SSL\s0 v2 and may need the \fB\-ssl2\fR option.
263 .Ip "\fB\-bugs\fR" 4
264 .IX Item "-bugs"
265 there are several known bug in \s-1SSL\s0 and \s-1TLS\s0 implementations. Adding this
266 option enables various workarounds.
267 .Ip "\fB\-cipher cipherlist\fR" 4
268 .IX Item "-cipher cipherlist"
269 this allows the cipher list sent by the client to be modified. Although
270 the server determines which cipher suite is used it should take the first
271 supported cipher in the list sent by the client. See the \fBciphers\fR
272 command for more information.
273 .Ip "\fB\-rand \f(BIfile\fB\|(s)\fR" 4
274 .IX Item "-rand file"
275 a file or files containing random data used to seed the random number
276 generator, or an \s-1EGD\s0 socket (see RAND_egd(3)).
277 Multiple files can be specified separated by a OS-dependent character.
278 The separator is \fB;\fR for MS-Windows, \fB,\fR for OpenVMS, and \fB:\fR for
279 all others.
280 .SH "CONNECTED COMMANDS"
281 .IX Header "CONNECTED COMMANDS"
282 If a connection is established with an \s-1SSL\s0 server then any data received
283 from the server is displayed and any key presses will be sent to the
284 server. When used interactively (which means neither \fB\-quiet\fR nor \fB\-ign_eof\fR
285 have been given), the session will be renegociated if the line begins with an
286 \&\fBR\fR, and if the line begins with a \fBQ\fR or if end of file is reached, the
287 connection will be closed down.
288 .SH "NOTES"
289 .IX Header "NOTES"
290 \&\fBs_client\fR can be used to debug \s-1SSL\s0 servers. To connect to an \s-1SSL\s0 \s-1HTTP\s0
291 server the command:
292 .PP
293 .Vb 1
294 \& openssl s_client -connect servername:443
295 .Ve
296 would typically be used (https uses port 443). If the connection succeeds
297 then an \s-1HTTP\s0 command can be given such as \*(L"\s-1GET\s0 /\*(R" to retrieve a web page.
298 .PP
299 If the handshake fails then there are several possible causes, if it is
300 nothing obvious like no client certificate then the \fB\-bugs\fR, \fB\-ssl2\fR,
301 \&\fB\-ssl3\fR, \fB\-tls1\fR, \fB\-no_ssl2\fR, \fB\-no_ssl3\fR, \fB\-no_tls1\fR can be tried
302 in case it is a buggy server. In particular you should play with these
303 options \fBbefore\fR submitting a bug report to an OpenSSL mailing list.
304 .PP
305 A frequent problem when attempting to get client certificates working
306 is that a web client complains it has no certificates or gives an empty
307 list to choose from. This is normally because the server is not sending
308 the clients certificate authority in its \*(L"acceptable \s-1CA\s0 list\*(R" when it
309 requests a certificate. By using \fBs_client\fR the \s-1CA\s0 list can be viewed
310 and checked. However some servers only request client authentication
311 after a specific \s-1URL\s0 is requested. To obtain the list in this case it
312 is necessary to use the \fB\-prexit\fR command and send an \s-1HTTP\s0 request
313 for an appropriate page.
314 .PP
315 If a certificate is specified on the command line using the \fB\-cert\fR
316 option it will not be used unless the server specifically requests
317 a client certificate. Therefor merely including a client certificate
318 on the command line is no guarantee that the certificate works.
319 .PP
320 If there are problems verifying a server certificate then the
321 \&\fB\-showcerts\fR option can be used to show the whole chain.
322 .SH "BUGS"
323 .IX Header "BUGS"
324 Because this program has a lot of options and also because some of
325 the techniques used are rather old, the C source of s_client is rather
326 hard to read and not a model of how things should be done. A typical
327 \&\s-1SSL\s0 client program would be much simpler.
328 .PP
329 The \fB\-verify\fR option should really exit if the server verification
330 fails.
331 .PP
332 The \fB\-prexit\fR option is a bit of a hack. We should really report
333 information whenever a session is renegotiated.
334 .SH "SEE ALSO"
335 .IX Header "SEE ALSO"
336 sess_id(1), s_server(1), ciphers(1)