From: William Lallemand Date: Thu, 19 Mar 2020 19:26:02 +0000 (+0100) Subject: MINOR: ssl/cli: show certificate status in 'show ssl cert' X-Git-Tag: v2.2-dev5~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=59c16fc2cb65bb8615879bce948df73421db4a3c;p=thirdparty%2Fhaproxy.git MINOR: ssl/cli: show certificate status in 'show ssl cert' Display the status of the certificate in 'show ssl cert'. Example: Status: Empty Status: Unused Status: Used --- diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 83bbaca093..a92f9c9131 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -11254,6 +11254,14 @@ static int cli_io_handler_show_cert_detail(struct appctx *appctx) chunk_appendf(out, "*"); chunk_appendf(out, "%s\n", ckchs->path); + chunk_appendf(out, "Status: "); + if (ckchs->ckch->cert == NULL) + chunk_appendf(out, "Empty\n"); + else if (LIST_ISEMPTY(&ckchs->ckch_inst)) + chunk_appendf(out, "Unused\n"); + else + chunk_appendf(out, "Used\n"); + if (ckchs->ckch->cert == NULL) goto end;