h2load: Show default cipher list in -h

This commit is contained in:
Tatsuhiro Tsujikawa 2017-01-09 14:47:32 +09:00
parent cbca2e35b5
commit 7e1a0d204b
1 changed files with 6 additions and 10 deletions

View File

@ -79,7 +79,8 @@ bool recorded(const std::chrono::steady_clock::time_point &t) {
} // namespace } // namespace
Config::Config() Config::Config()
: data_length(-1), : ciphers(ssl::DEFAULT_CIPHER_LIST),
data_length(-1),
addrs(nullptr), addrs(nullptr),
nreqs(1), nreqs(1),
nclients(1), nclients(1),
@ -1702,6 +1703,8 @@ Options:
--ciphers=<SUITE> --ciphers=<SUITE>
Set allowed cipher list. The format of the string is Set allowed cipher list. The format of the string is
described in OpenSSL ciphers(1). described in OpenSSL ciphers(1).
Default: )"
<< config.ciphers << R"(
-p, --no-tls-proto=<PROTOID> -p, --no-tls-proto=<PROTOID>
Specify ALPN identifier of the protocol to be used when Specify ALPN identifier of the protocol to be used when
accessing http URI without SSL/TLS.)"; accessing http URI without SSL/TLS.)";
@ -2246,15 +2249,8 @@ int main(int argc, char **argv) {
SSL_CTX_set_mode(ssl_ctx, SSL_MODE_AUTO_RETRY); SSL_CTX_set_mode(ssl_ctx, SSL_MODE_AUTO_RETRY);
SSL_CTX_set_mode(ssl_ctx, SSL_MODE_RELEASE_BUFFERS); SSL_CTX_set_mode(ssl_ctx, SSL_MODE_RELEASE_BUFFERS);
const char *ciphers; if (SSL_CTX_set_cipher_list(ssl_ctx, config.ciphers.c_str()) == 0) {
if (config.ciphers.empty()) { std::cerr << "SSL_CTX_set_cipher_list with " << config.ciphers
ciphers = ssl::DEFAULT_CIPHER_LIST;
} else {
ciphers = config.ciphers.c_str();
}
if (SSL_CTX_set_cipher_list(ssl_ctx, ciphers) == 0) {
std::cerr << "SSL_CTX_set_cipher_list with " << ciphers
<< " failed: " << ERR_error_string(ERR_get_error(), nullptr) << " failed: " << ERR_error_string(ERR_get_error(), nullptr)
<< std::endl; << std::endl;
exit(EXIT_FAILURE); exit(EXIT_FAILURE);