summaryrefslogtreecommitdiffstats
path: root/src/h2load.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:53:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 08:53:16 +0000
commitfef16cb88298ba07a9841a5a98e5afaa48bcb6d6 (patch)
tree4c895c4ad1fdad31773ded63e5a1effb74185315 /src/h2load.cc
parentReleasing progress-linux version 1.60.0-1~progress7.99u1. (diff)
downloadnghttp2-fef16cb88298ba07a9841a5a98e5afaa48bcb6d6.tar.xz
nghttp2-fef16cb88298ba07a9841a5a98e5afaa48bcb6d6.zip
Merging upstream version 1.61.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/h2load.cc')
-rw-r--r--src/h2load.cc23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/h2load.cc b/src/h2load.cc
index 8136a9f..4f9f00e 100644
--- a/src/h2load.cc
+++ b/src/h2load.cc
@@ -87,15 +87,6 @@ bool recorded(const std::chrono::steady_clock::time_point &t) {
}
} // namespace
-namespace {
-std::ofstream keylog_file;
-void keylog_callback(const SSL *ssl, const char *line) {
- keylog_file.write(line, strlen(line));
- keylog_file.put('\n');
- keylog_file.flush();
-}
-} // namespace
-
Config::Config()
: ciphers(tls::DEFAULT_CIPHER_LIST),
tls13_ciphers("TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_"
@@ -2977,12 +2968,10 @@ int main(int argc, char **argv) {
SSL_CTX_set_alpn_protos(ssl_ctx, proto_list.data(), proto_list.size());
- auto keylog_filename = getenv("SSLKEYLOGFILE");
- if (keylog_filename) {
- keylog_file.open(keylog_filename, std::ios_base::app);
- if (keylog_file) {
- SSL_CTX_set_keylog_callback(ssl_ctx, keylog_callback);
- }
+ if (tls::setup_keylog_callback(ssl_ctx) != 0) {
+ std::cerr << "Failed to setup keylog" << std::endl;
+
+ exit(EXIT_FAILURE);
}
#if defined(NGHTTP2_OPENSSL_IS_BORINGSSL) && defined(HAVE_LIBBROTLI)
@@ -3002,7 +2991,7 @@ int main(int argc, char **argv) {
shared_nva.emplace_back("user-agent", user_agent);
// list header fields that can be overridden.
- auto override_hdrs = make_array<std::string>(":authority", ":host", ":method",
+ auto override_hdrs = make_array<std::string>(":authority", "host", ":method",
":scheme", "user-agent");
for (auto &kv : config.custom_headers) {
@@ -3010,7 +2999,7 @@ int main(int argc, char **argv) {
kv.name) != std::end(override_hdrs)) {
// override header
for (auto &nv : shared_nva) {
- if ((nv.name == ":authority" && kv.name == ":host") ||
+ if ((nv.name == ":authority" && kv.name == "host") ||
(nv.name == kv.name)) {
nv.value = kv.value;
}