]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Only require ssl_dh is ssl is turned on
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 16 Aug 2016 07:11:04 +0000 (10:11 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 16 Aug 2016 07:12:03 +0000 (10:12 +0300)
src/config/config-request.c

index 7fbac9c50410c597be9a573a7a6aed2faf4e73bc..94de90e1568a17b735cabec5997810e05da6542e 100644 (file)
@@ -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));