]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl: clarify ssl-f-use errors in post-section parsing
authorWilliam Lallemand <wlallemand@haproxy.com>
Mon, 16 Feb 2026 17:22:53 +0000 (18:22 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Mon, 16 Feb 2026 17:41:08 +0000 (18:41 +0100)
crtlist_load_crt() in post_section_frontend_crt_init() won't give
details about the line being parsed, this should be done by the caller.

Modify post_section_frontend_crt_init() to ouput the right error format.

Must be backported to 3.2.

src/cfgparse-ssl.c

index 967b0519f1abf48ca2918249a5918aa3fa624806..5053cf336e86a6ae6276a13046a65be6155a7e49 100644 (file)
@@ -2561,8 +2561,11 @@ static int post_section_frontend_crt_init()
                entry->ssl_conf = crtlist_dup_ssl_conf(n->ssl_conf);
 
                err_code |= crtlist_load_crt(n->ckch_conf->crt, n->ckch_conf, newlist, entry, n->filename, n->linenum, &err);
-               if (err_code & ERR_CODE)
+               if (err_code & ERR_CODE) {
+                       ha_alert("parsing [%s:%d] : %s", n->filename, n->linenum, err);
+                       ha_free(&err);
                        goto error;
+               }
 
                LIST_DELETE(&n->list);
                /* n->ssl_conf is reused so we don't free them here */
@@ -2574,7 +2577,8 @@ static int post_section_frontend_crt_init()
        if (newlist) {
 
                if (ebst_insert(&crtlists_tree, &newlist->node) != &newlist->node) {
-                       memprintf(&err, "Couldn't create the crt-list '%s', this name is already used by another crt-list!", crtlist_name);
+                       memprintf(&err, "parsing [%s:%d] : Couldn't create the crt-list '%s', this name is already used by another crt-list!",
+                                 curproxy->conf.file, curproxy->conf.line, crtlist_name);
                        err_code |= ERR_ALERT | ERR_FATAL;
                        goto error;
                }
@@ -2594,7 +2598,7 @@ static int post_section_frontend_crt_init()
 error:
 
        if (err)
-               ha_alert("%s.\n", err);
+               ha_alert("%s", err);
        free(err);
 
        list_for_each_entry_safe(n, r, &cur_crtlist, list) {