1b077aed3SPierre Pronchery=pod 2b077aed3SPierre Pronchery{- OpenSSL::safe::output_do_not_edit_headers(); -} 3b077aed3SPierre Pronchery 4b077aed3SPierre Pronchery=head1 NAME 5b077aed3SPierre Pronchery 6b077aed3SPierre Proncheryopenssl-s_time - SSL/TLS performance timing program 7b077aed3SPierre Pronchery 8b077aed3SPierre Pronchery=head1 SYNOPSIS 9b077aed3SPierre Pronchery 10b077aed3SPierre ProncheryB<openssl> B<s_time> 11b077aed3SPierre Pronchery[B<-help>] 12b077aed3SPierre Pronchery[B<-connect> I<host>:I<port>] 13b077aed3SPierre Pronchery[B<-www> I<page>] 14b077aed3SPierre Pronchery[B<-cert> I<filename>] 15b077aed3SPierre Pronchery[B<-key> I<filename>] 16b077aed3SPierre Pronchery[B<-reuse>] 17b077aed3SPierre Pronchery[B<-new>] 18b077aed3SPierre Pronchery[B<-verify> I<depth>] 19b077aed3SPierre Pronchery[B<-time> I<seconds>] 20b077aed3SPierre Pronchery[B<-ssl3>] 21b077aed3SPierre Pronchery[B<-tls1>] 22b077aed3SPierre Pronchery[B<-tls1_1>] 23b077aed3SPierre Pronchery[B<-tls1_2>] 24b077aed3SPierre Pronchery[B<-tls1_3>] 25b077aed3SPierre Pronchery[B<-bugs>] 26b077aed3SPierre Pronchery[B<-cipher> I<cipherlist>] 27b077aed3SPierre Pronchery[B<-ciphersuites> I<val>] 28b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_name_synopsis -} 29b077aed3SPierre Pronchery[B<-cafile> I<file>] 30b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_trust_synopsis -} 31b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_provider_synopsis -} 32b077aed3SPierre Pronchery 33b077aed3SPierre Pronchery=head1 DESCRIPTION 34b077aed3SPierre Pronchery 35b077aed3SPierre ProncheryThis command implements a generic SSL/TLS client which 36b077aed3SPierre Proncheryconnects to a remote host using SSL/TLS. It can request a page from the server 37b077aed3SPierre Proncheryand includes the time to transfer the payload data in its timing measurements. 38b077aed3SPierre ProncheryIt measures the number of connections within a given timeframe, the amount of 39b077aed3SPierre Proncherydata transferred (if any), and calculates the average time spent for one 40b077aed3SPierre Proncheryconnection. 41b077aed3SPierre Pronchery 42b077aed3SPierre Pronchery=head1 OPTIONS 43b077aed3SPierre Pronchery 44b077aed3SPierre Pronchery=over 4 45b077aed3SPierre Pronchery 46b077aed3SPierre Pronchery=item B<-help> 47b077aed3SPierre Pronchery 48b077aed3SPierre ProncheryPrint out a usage message. 49b077aed3SPierre Pronchery 50b077aed3SPierre Pronchery=item B<-connect> I<host>:I<port> 51b077aed3SPierre Pronchery 52b077aed3SPierre ProncheryThis specifies the host and optional port to connect to. 53*0d0c8621SEnji CooperIf the host string is an IPv6 address, it must be enclosed in C<[> and C<]>. 54b077aed3SPierre Pronchery 55b077aed3SPierre Pronchery=item B<-www> I<page> 56b077aed3SPierre Pronchery 57b077aed3SPierre ProncheryThis specifies the page to GET from the server. A value of '/' gets the 58b077aed3SPierre ProncheryF<index.html> page. If this parameter is not specified, then this command 59b077aed3SPierre Proncherywill only perform the handshake to establish SSL connections but not transfer 60b077aed3SPierre Proncheryany payload data. 61b077aed3SPierre Pronchery 62b077aed3SPierre Pronchery=item B<-cert> I<certname> 63b077aed3SPierre Pronchery 64b077aed3SPierre ProncheryThe certificate to use, if one is requested by the server. The default is 65b077aed3SPierre Proncherynot to use a certificate. The file is in PEM format. 66b077aed3SPierre Pronchery 67b077aed3SPierre Pronchery=item B<-key> I<keyfile> 68b077aed3SPierre Pronchery 69b077aed3SPierre ProncheryThe private key to use. If not specified then the certificate file will 70b077aed3SPierre Proncherybe used. The file is in PEM format. 71b077aed3SPierre Pronchery 72b077aed3SPierre Pronchery=item B<-verify> I<depth> 73b077aed3SPierre Pronchery 74b077aed3SPierre ProncheryThe verify depth to use. This specifies the maximum length of the 75b077aed3SPierre Proncheryserver certificate chain and turns on server certificate verification. 76b077aed3SPierre ProncheryCurrently the verify operation continues after errors so all the problems 77b077aed3SPierre Proncherywith a certificate chain can be seen. As a side effect the connection 78b077aed3SPierre Proncherywill never fail due to a server certificate verify failure. 79b077aed3SPierre Pronchery 80b077aed3SPierre Pronchery=item B<-new> 81b077aed3SPierre Pronchery 82b077aed3SPierre ProncheryPerforms the timing test using a new session ID for each connection. 83b077aed3SPierre ProncheryIf neither B<-new> nor B<-reuse> are specified, they are both on by default 84b077aed3SPierre Proncheryand executed in sequence. 85b077aed3SPierre Pronchery 86b077aed3SPierre Pronchery=item B<-reuse> 87b077aed3SPierre Pronchery 88b077aed3SPierre ProncheryPerforms the timing test using the same session ID; this can be used as a test 89b077aed3SPierre Proncherythat session caching is working. If neither B<-new> nor B<-reuse> are 90b077aed3SPierre Proncheryspecified, they are both on by default and executed in sequence. 91b077aed3SPierre Pronchery 92b077aed3SPierre Pronchery=item B<-bugs> 93b077aed3SPierre Pronchery 94b077aed3SPierre ProncheryThere are several known bugs in SSL and TLS implementations. Adding this 95b077aed3SPierre Proncheryoption enables various workarounds. 96b077aed3SPierre Pronchery 97b077aed3SPierre Pronchery=item B<-cipher> I<cipherlist> 98b077aed3SPierre Pronchery 99b077aed3SPierre ProncheryThis allows the TLSv1.2 and below cipher list sent by the client to be modified. 100b077aed3SPierre ProncheryThis list will be combined with any TLSv1.3 ciphersuites that have been 101b077aed3SPierre Proncheryconfigured. Although the server determines which cipher suite is used it should 102b077aed3SPierre Proncherytake the first supported cipher in the list sent by the client. See 103b077aed3SPierre ProncheryL<openssl-ciphers(1)> for more information. 104b077aed3SPierre Pronchery 105b077aed3SPierre Pronchery=item B<-ciphersuites> I<val> 106b077aed3SPierre Pronchery 107b077aed3SPierre ProncheryThis allows the TLSv1.3 ciphersuites sent by the client to be modified. This 108b077aed3SPierre Proncherylist will be combined with any TLSv1.2 and below ciphersuites that have been 109b077aed3SPierre Proncheryconfigured. Although the server determines which cipher suite is used it should 110b077aed3SPierre Proncherytake the first supported cipher in the list sent by the client. See 111b077aed3SPierre ProncheryL<openssl-ciphers(1)> for more information. The format for this list is a 112b077aed3SPierre Proncherysimple colon (":") separated list of TLSv1.3 ciphersuite names. 113b077aed3SPierre Pronchery 114b077aed3SPierre Pronchery=item B<-time> I<length> 115b077aed3SPierre Pronchery 116b077aed3SPierre ProncherySpecifies how long (in seconds) this command should establish connections 117b077aed3SPierre Proncheryand optionally transfer payload data from a server. Server and client 118b077aed3SPierre Proncheryperformance and the link speed determine how many connections it 119b077aed3SPierre Proncherycan establish. 120b077aed3SPierre Pronchery 121b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_name_item -} 122b077aed3SPierre Pronchery 123b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_trust_item -} 124b077aed3SPierre Pronchery 125b077aed3SPierre Pronchery{- $OpenSSL::safe::opt_provider_item -} 126b077aed3SPierre Pronchery 127b077aed3SPierre Pronchery=item B<-cafile> I<file> 128b077aed3SPierre Pronchery 129b077aed3SPierre ProncheryThis is an obsolete synonym for B<-CAfile>. 130b077aed3SPierre Pronchery 131b077aed3SPierre Pronchery=item B<-ssl3>, B<-tls1>, B<-tls1_1>, B<-tls1_2>, B<-tls1_3> 132b077aed3SPierre Pronchery 133b077aed3SPierre ProncherySee L<openssl(1)/TLS Version Options>. 134b077aed3SPierre Pronchery 135b077aed3SPierre Pronchery=back 136b077aed3SPierre Pronchery 137b077aed3SPierre Pronchery=head1 NOTES 138b077aed3SPierre Pronchery 139b077aed3SPierre ProncheryThis command can be used to measure the performance of an SSL connection. 140b077aed3SPierre ProncheryTo connect to an SSL HTTP server and get the default page the command 141b077aed3SPierre Pronchery 142b077aed3SPierre Pronchery openssl s_time -connect servername:443 -www / -CApath yourdir -CAfile yourfile.pem -cipher commoncipher [-ssl3] 143b077aed3SPierre Pronchery 144b077aed3SPierre Proncherywould typically be used (https uses port 443). I<commoncipher> is a cipher to 145b077aed3SPierre Proncherywhich both client and server can agree, see the L<openssl-ciphers(1)> command 146b077aed3SPierre Proncheryfor details. 147b077aed3SPierre Pronchery 148b077aed3SPierre ProncheryIf the handshake fails then there are several possible causes, if it is 149b077aed3SPierre Proncherynothing obvious like no client certificate then the B<-bugs> and 150b077aed3SPierre ProncheryB<-ssl3> options can be tried 151b077aed3SPierre Proncheryin case it is a buggy server. In particular you should play with these 152b077aed3SPierre Proncheryoptions B<before> submitting a bug report to an OpenSSL mailing list. 153b077aed3SPierre Pronchery 154b077aed3SPierre ProncheryA frequent problem when attempting to get client certificates working 155b077aed3SPierre Proncheryis that a web client complains it has no certificates or gives an empty 156b077aed3SPierre Proncherylist to choose from. This is normally because the server is not sending 157b077aed3SPierre Proncherythe clients certificate authority in its "acceptable CA list" when it 158b077aed3SPierre Proncheryrequests a certificate. By using L<openssl-s_client(1)> the CA list can be 159b077aed3SPierre Proncheryviewed and checked. However, some servers only request client authentication 160b077aed3SPierre Proncheryafter a specific URL is requested. To obtain the list in this case it 161b077aed3SPierre Proncheryis necessary to use the B<-prexit> option of L<openssl-s_client(1)> and 162b077aed3SPierre Proncherysend an HTTP request for an appropriate page. 163b077aed3SPierre Pronchery 164b077aed3SPierre ProncheryIf a certificate is specified on the command line using the B<-cert> 165b077aed3SPierre Proncheryoption it will not be used unless the server specifically requests 166b077aed3SPierre Proncherya client certificate. Therefore, merely including a client certificate 167b077aed3SPierre Proncheryon the command line is no guarantee that the certificate works. 168b077aed3SPierre Pronchery 169b077aed3SPierre Pronchery=head1 BUGS 170b077aed3SPierre Pronchery 171b077aed3SPierre ProncheryBecause this program does not have all the options of the 172b077aed3SPierre ProncheryL<openssl-s_client(1)> program to turn protocols on and off, you may not 173b077aed3SPierre Proncherybe able to measure the performance of all protocols with all servers. 174b077aed3SPierre Pronchery 175b077aed3SPierre ProncheryThe B<-verify> option should really exit if the server verification 176b077aed3SPierre Proncheryfails. 177b077aed3SPierre Pronchery 178b077aed3SPierre Pronchery=head1 HISTORY 179b077aed3SPierre Pronchery 180b077aed3SPierre ProncheryThe B<-cafile> option was deprecated in OpenSSL 3.0. 181b077aed3SPierre Pronchery 182b077aed3SPierre Pronchery=head1 SEE ALSO 183b077aed3SPierre Pronchery 184b077aed3SPierre ProncheryL<openssl(1)>, 185b077aed3SPierre ProncheryL<openssl-s_client(1)>, 186b077aed3SPierre ProncheryL<openssl-s_server(1)>, 187b077aed3SPierre ProncheryL<openssl-ciphers(1)>, 188b077aed3SPierre ProncheryL<ossl_store-file(7)> 189b077aed3SPierre Pronchery 190b077aed3SPierre Pronchery=head1 COPYRIGHT 191b077aed3SPierre Pronchery 192b077aed3SPierre ProncheryCopyright 2004-2021 The OpenSSL Project Authors. All Rights Reserved. 193b077aed3SPierre Pronchery 194b077aed3SPierre ProncheryLicensed under the Apache License 2.0 (the "License"). You may not use 195b077aed3SPierre Proncherythis file except in compliance with the License. You can obtain a copy 196b077aed3SPierre Proncheryin the file LICENSE in the source distribution or at 197b077aed3SPierre ProncheryL<https://www.openssl.org/source/license.html>. 198b077aed3SPierre Pronchery 199b077aed3SPierre Pronchery=cut 200