nghttpx: Use ImmutableString for dh_param_file
This commit is contained in:
parent
35ebdd35bc
commit
2344932b45
|
@ -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: {
|
||||
|
|
|
@ -429,7 +429,7 @@ struct TLSConfig {
|
|||
ImmutableString private_key_file;
|
||||
ImmutableString private_key_passwd;
|
||||
ImmutableString cert_file;
|
||||
std::unique_ptr<char[]> dh_param_file;
|
||||
ImmutableString dh_param_file;
|
||||
std::unique_ptr<char[]> ciphers;
|
||||
ImmutableString cacert;
|
||||
bool insecure;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue