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