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;
|
return 0;
|
||||||
case SHRPX_OPTID_DH_PARAM_FILE:
|
case SHRPX_OPTID_DH_PARAM_FILE:
|
||||||
mod_config()->tls.dh_param_file = strcopy(optarg);
|
mod_config()->tls.dh_param_file = optarg;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
case SHRPX_OPTID_SUBCERT: {
|
case SHRPX_OPTID_SUBCERT: {
|
||||||
|
|
|
@ -429,7 +429,7 @@ struct TLSConfig {
|
||||||
ImmutableString private_key_file;
|
ImmutableString private_key_file;
|
||||||
ImmutableString private_key_passwd;
|
ImmutableString private_key_passwd;
|
||||||
ImmutableString cert_file;
|
ImmutableString cert_file;
|
||||||
std::unique_ptr<char[]> dh_param_file;
|
ImmutableString dh_param_file;
|
||||||
std::unique_ptr<char[]> ciphers;
|
std::unique_ptr<char[]> ciphers;
|
||||||
ImmutableString cacert;
|
ImmutableString cacert;
|
||||||
bool insecure;
|
bool insecure;
|
||||||
|
|
|
@ -527,9 +527,9 @@ SSL_CTX *create_ssl_context(const char *private_key_file, const char *cert_file
|
||||||
|
|
||||||
#endif // OPENSSL_NO_EC
|
#endif // OPENSSL_NO_EC
|
||||||
|
|
||||||
if (tlsconf.dh_param_file) {
|
if (!tlsconf.dh_param_file.empty()) {
|
||||||
// Read DH parameters from file
|
// 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) {
|
if (bio == nullptr) {
|
||||||
LOG(FATAL) << "BIO_new_file() failed: "
|
LOG(FATAL) << "BIO_new_file() failed: "
|
||||||
<< ERR_error_string(ERR_get_error(), nullptr);
|
<< ERR_error_string(ERR_get_error(), nullptr);
|
||||||
|
|
Loading…
Reference in New Issue