s_time.pod 7.2 KB

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