From 2344932b45e5b22b37651ab2b432f0bb2504ba06 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sun, 14 Feb 2016 21:22:28 +0900 Subject: [PATCH] nghttpx: Use ImmutableString for dh_param_file --- src/shrpx_config.cc | 2 +- src/shrpx_config.h | 2 +- src/shrpx_ssl.cc | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/shrpx_config.cc b/src/shrpx_config.cc index 0682149f..24e89d05 100644 --- a/src/shrpx_config.cc +++ b/src/shrpx_config.cc @@ -1763,7 +1763,7 @@ int parse_config(const char *opt, const char *optarg, return 0; case SHRPX_OPTID_DH_PARAM_FILE: - mod_config()->tls.dh_param_file = strcopy(optarg); + mod_config()->tls.dh_param_file = optarg; return 0; case SHRPX_OPTID_SUBCERT: { diff --git a/src/shrpx_config.h b/src/shrpx_config.h index 3f5a8565..dbe8c9a5 100644 --- a/src/shrpx_config.h +++ b/src/shrpx_config.h @@ -429,7 +429,7 @@ struct TLSConfig { ImmutableString private_key_file; ImmutableString private_key_passwd; ImmutableString cert_file; - std::unique_ptr dh_param_file; + ImmutableString dh_param_file; std::unique_ptr ciphers; ImmutableString cacert; bool insecure; diff --git a/src/shrpx_ssl.cc b/src/shrpx_ssl.cc index f5d2b594..a7e00086 100644 --- a/src/shrpx_ssl.cc +++ b/src/shrpx_ssl.cc @@ -527,9 +527,9 @@ SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file #endif // OPENSSL_NO_EC - if (tlsconf.dh_param_file) { + if (!tlsconf.dh_param_file.empty()) { // Read DH parameters from file - auto bio = BIO_new_file(tlsconf.dh_param_file.get(), "r"); + auto bio = BIO_new_file(tlsconf.dh_param_file.c_str(), "r"); if (bio == nullptr) { LOG(FATAL) << "BIO_new_file() failed: " << ERR_error_string(ERR_get_error(), nullptr);