MINOR: ssl/cli: improve error for bundle in add/del ssl crt-list

Bundles are deprecated and can't be used with the crt-list command of
the CLI, improve the error output when trying to use them so the users
can disable them.
This commit is contained in:
William Lallemand 2020-04-08 10:57:24 +02:00 committed by William Lallemand
parent 463b524298
commit 36ccc3922d
1 changed files with 8 additions and 0 deletions

View File

@ -11455,6 +11455,10 @@ static int cli_parse_add_crtlist(char **args, char *payload, struct appctx *appc
memprintf(&err, "certificate '%s' does not exist!", cert_path); memprintf(&err, "certificate '%s' does not exist!", cert_path);
goto error; goto error;
} }
if (store->multi) {
memprintf(&err, "certificate '%s' is a bundle. You can disable the bundle merging with the directive 'ssl-load-extra-files' in the global section.", cert_path);
goto error;
}
if (store->ckch == NULL || store->ckch->cert == NULL) { if (store->ckch == NULL || store->ckch->cert == NULL) {
memprintf(&err, "certificate '%s' is empty!", cert_path); memprintf(&err, "certificate '%s' is empty!", cert_path);
goto error; goto error;
@ -11543,6 +11547,10 @@ static int cli_parse_del_crtlist(char **args, char *payload, struct appctx *appc
memprintf(&err, "certificate '%s' does not exist!", cert_path); memprintf(&err, "certificate '%s' does not exist!", cert_path);
goto error; goto error;
} }
if (store->multi) {
memprintf(&err, "certificate '%s' is a bundle. You can disable the bundle merging with the directive 'ssl-load-extra-files' in the global section.", cert_path);
goto error;
}
if (store->ckch == NULL || store->ckch->cert == NULL) { if (store->ckch == NULL || store->ckch->cert == NULL) {
memprintf(&err, "certificate '%s' is empty!", cert_path); memprintf(&err, "certificate '%s' is empty!", cert_path);
goto error; goto error;