From: Aki Tuomi Date: Tue, 16 Aug 2016 07:11:04 +0000 (+0300) Subject: config: Only require ssl_dh is ssl is turned on X-Git-Tag: 2.3.0.rc1~3151 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de4869f239d3cae00f4ddab43edb01f8b0223f7d;p=thirdparty%2Fdovecot%2Fcore.git config: Only require ssl_dh is ssl is turned on --- diff --git a/src/config/config-request.c b/src/config/config-request.c index 7fbac9c504..94de90e156 100644 --- a/src/config/config-request.c +++ b/src/config/config-request.c @@ -443,13 +443,15 @@ int config_export_finish(struct config_export_context **_ctx) continue; T_BEGIN { - /* maybe do it here */ - if (settings_parse_is_valid_key(parser->parser, "ssl_dh")) { - enum setting_type stype; - const char *const *value = settings_parse_get_value(parser->parser, + enum setting_type stype; + const char *const *value = settings_parse_get_value(parser->parser, "ssl", &stype); + + if (value != NULL && strcmp(*value, "no") != 0 && + settings_parse_is_valid_key(parser->parser, "ssl_dh")) { + value = settings_parse_get_value(parser->parser, "ssl_dh", &stype); - if (**value == '\0') { + if (value == NULL || **value == '\0') { const char *newval; if (old_settings_ssl_dh_load(&newval, &error)) { settings_parse_line(parser->parser, t_strdup_printf("%s=%s", "ssl_dh", newval));