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