xref: /onnv-gate/usr/src/common/openssl/doc/apps/s_time.pod (revision 2175:b0b2f052a486)
1*2175Sjp161948
2*2175Sjp161948=pod
3*2175Sjp161948
4*2175Sjp161948=head1 NAME
5*2175Sjp161948
6*2175Sjp161948s_time - SSL/TLS performance timing program
7*2175Sjp161948
8*2175Sjp161948=head1 SYNOPSIS
9*2175Sjp161948
10*2175Sjp161948B<openssl> B<s_time>
11*2175Sjp161948[B<-connect host:port>]
12*2175Sjp161948[B<-www page>]
13*2175Sjp161948[B<-cert filename>]
14*2175Sjp161948[B<-key filename>]
15*2175Sjp161948[B<-CApath directory>]
16*2175Sjp161948[B<-CAfile filename>]
17*2175Sjp161948[B<-reuse>]
18*2175Sjp161948[B<-new>]
19*2175Sjp161948[B<-verify depth>]
20*2175Sjp161948[B<-nbio>]
21*2175Sjp161948[B<-time seconds>]
22*2175Sjp161948[B<-ssl2>]
23*2175Sjp161948[B<-ssl3>]
24*2175Sjp161948[B<-bugs>]
25*2175Sjp161948[B<-cipher cipherlist>]
26*2175Sjp161948
27*2175Sjp161948=head1 DESCRIPTION
28*2175Sjp161948
29*2175Sjp161948The B<s_client> command implements a generic SSL/TLS client which connects to a
30*2175Sjp161948remote host using SSL/TLS. It can request a page from the server and includes
31*2175Sjp161948the time to transfer the payload data in its timing measurements. It measures
32*2175Sjp161948the number of connections within a given timeframe, the amount of data
33*2175Sjp161948transferred (if any), and calculates the average time spent for one connection.
34*2175Sjp161948
35*2175Sjp161948=head1 OPTIONS
36*2175Sjp161948
37*2175Sjp161948=over 4
38*2175Sjp161948
39*2175Sjp161948=item B<-connect host:port>
40*2175Sjp161948
41*2175Sjp161948This specifies the host and optional port to connect to.
42*2175Sjp161948
43*2175Sjp161948=item B<-www page>
44*2175Sjp161948
45*2175Sjp161948This specifies the page to GET from the server. A value of '/' gets the
46*2175Sjp161948index.htm[l] page. If this parameter is not specified, then B<s_time> will only
47*2175Sjp161948perform the handshake to establish SSL connections but not transfer any
48*2175Sjp161948payload data.
49*2175Sjp161948
50*2175Sjp161948=item B<-cert certname>
51*2175Sjp161948
52*2175Sjp161948The certificate to use, if one is requested by the server. The default is
53*2175Sjp161948not to use a certificate. The file is in PEM format.
54*2175Sjp161948
55*2175Sjp161948=item B<-key keyfile>
56*2175Sjp161948
57*2175Sjp161948The private key to use. If not specified then the certificate file will
58*2175Sjp161948be used. The file is in PEM format.
59*2175Sjp161948
60*2175Sjp161948=item B<-verify depth>
61*2175Sjp161948
62*2175Sjp161948The verify depth to use. This specifies the maximum length of the
63*2175Sjp161948server certificate chain and turns on server certificate verification.
64*2175Sjp161948Currently the verify operation continues after errors so all the problems
65*2175Sjp161948with a certificate chain can be seen. As a side effect the connection
66*2175Sjp161948will never fail due to a server certificate verify failure.
67*2175Sjp161948
68*2175Sjp161948=item B<-CApath directory>
69*2175Sjp161948
70*2175Sjp161948The directory to use for server certificate verification. This directory
71*2175Sjp161948must be in "hash format", see B<verify> for more information. These are
72*2175Sjp161948also used when building the client certificate chain.
73*2175Sjp161948
74*2175Sjp161948=item B<-CAfile file>
75*2175Sjp161948
76*2175Sjp161948A file containing trusted certificates to use during server authentication
77*2175Sjp161948and to use when attempting to build the client certificate chain.
78*2175Sjp161948
79*2175Sjp161948=item B<-new>
80*2175Sjp161948
81*2175Sjp161948performs the timing test using a new session ID for each connection.
82*2175Sjp161948If neither B<-new> nor B<-reuse> are specified, they are both on by default
83*2175Sjp161948and executed in sequence.
84*2175Sjp161948
85*2175Sjp161948=item B<-reuse>
86*2175Sjp161948
87*2175Sjp161948performs the timing test using the same session ID; this can be used as a test
88*2175Sjp161948that session caching is working. If neither B<-new> nor B<-reuse> are
89*2175Sjp161948specified, they are both on by default and executed in sequence.
90*2175Sjp161948
91*2175Sjp161948=item B<-nbio>
92*2175Sjp161948
93*2175Sjp161948turns on non-blocking I/O.
94*2175Sjp161948
95*2175Sjp161948=item B<-ssl2>, B<-ssl3>
96*2175Sjp161948
97*2175Sjp161948these options disable the use of certain SSL or TLS protocols. By default
98*2175Sjp161948the initial handshake uses a method which should be compatible with all
99*2175Sjp161948servers and permit them to use SSL v3, SSL v2 or TLS as appropriate.
100*2175Sjp161948The timing program is not as rich in options to turn protocols on and off as
101*2175Sjp161948the L<s_client(1)|s_client(1)> program and may not connect to all servers.
102*2175Sjp161948
103*2175Sjp161948Unfortunately there are a lot of ancient and broken servers in use which
104*2175Sjp161948cannot handle this technique and will fail to connect. Some servers only
105*2175Sjp161948work if TLS is turned off with the B<-ssl3> option; others
106*2175Sjp161948will only support SSL v2 and may need the B<-ssl2> option.
107*2175Sjp161948
108*2175Sjp161948=item B<-bugs>
109*2175Sjp161948
110*2175Sjp161948there are several known bug in SSL and TLS implementations. Adding this
111*2175Sjp161948option enables various workarounds.
112*2175Sjp161948
113*2175Sjp161948=item B<-cipher cipherlist>
114*2175Sjp161948
115*2175Sjp161948this allows the cipher list sent by the client to be modified. Although
116*2175Sjp161948the server determines which cipher suite is used it should take the first
117*2175Sjp161948supported cipher in the list sent by the client.
118*2175Sjp161948See the L<ciphers(1)|ciphers(1)> command for more information.
119*2175Sjp161948
120*2175Sjp161948=item B<-time length>
121*2175Sjp161948
122*2175Sjp161948specifies how long (in seconds) B<s_time> should establish connections and
123*2175Sjp161948optionally transfer payload data from a server. Server and client performance
124*2175Sjp161948and the link speed determine how many connections B<s_time> can establish.
125*2175Sjp161948
126*2175Sjp161948=back
127*2175Sjp161948
128*2175Sjp161948=head1 NOTES
129*2175Sjp161948
130*2175Sjp161948B<s_client> can be used to measure the performance of an SSL connection.
131*2175Sjp161948To connect to an SSL HTTP server and get the default page the command
132*2175Sjp161948
133*2175Sjp161948 openssl s_time -connect servername:443 -www / -CApath yourdir -CAfile yourfile.pem -cipher commoncipher [-ssl3]
134*2175Sjp161948
135*2175Sjp161948would typically be used (https uses port 443). 'commoncipher' is a cipher to
136*2175Sjp161948which both client and server can agree, see the L<ciphers(1)|ciphers(1)> command
137*2175Sjp161948for details.
138*2175Sjp161948
139*2175Sjp161948If the handshake fails then there are several possible causes, if it is
140*2175Sjp161948nothing obvious like no client certificate then the B<-bugs>, B<-ssl2>,
141*2175Sjp161948B<-ssl3> options can be tried
142*2175Sjp161948in case it is a buggy server. In particular you should play with these
143*2175Sjp161948options B<before> submitting a bug report to an OpenSSL mailing list.
144*2175Sjp161948
145*2175Sjp161948A frequent problem when attempting to get client certificates working
146*2175Sjp161948is that a web client complains it has no certificates or gives an empty
147*2175Sjp161948list to choose from. This is normally because the server is not sending
148*2175Sjp161948the clients certificate authority in its "acceptable CA list" when it
149*2175Sjp161948requests a certificate. By using L<s_client(1)|s_client(1)> the CA list can be
150*2175Sjp161948viewed and checked. However some servers only request client authentication
151*2175Sjp161948after a specific URL is requested. To obtain the list in this case it
152*2175Sjp161948is necessary to use the B<-prexit> option of L<s_client(1)|s_client(1)> and
153*2175Sjp161948send an HTTP request for an appropriate page.
154*2175Sjp161948
155*2175Sjp161948If a certificate is specified on the command line using the B<-cert>
156*2175Sjp161948option it will not be used unless the server specifically requests
157*2175Sjp161948a client certificate. Therefor merely including a client certificate
158*2175Sjp161948on the command line is no guarantee that the certificate works.
159*2175Sjp161948
160*2175Sjp161948=head1 BUGS
161*2175Sjp161948
162*2175Sjp161948Because this program does not have all the options of the
163*2175Sjp161948L<s_client(1)|s_client(1)> program to turn protocols on and off, you may not be
164*2175Sjp161948able to measure the performance of all protocols with all servers.
165*2175Sjp161948
166*2175Sjp161948The B<-verify> option should really exit if the server verification
167*2175Sjp161948fails.
168*2175Sjp161948
169*2175Sjp161948=head1 SEE ALSO
170*2175Sjp161948
171*2175Sjp161948L<s_client(1)|s_client(1)>, L<s_server(1)|s_server(1)>, L<ciphers(1)|ciphers(1)>
172*2175Sjp161948
173*2175Sjp161948=cut
174