]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: ssl/cli: show certificate status in 'show ssl cert'
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 19 Mar 2020 19:26:02 +0000 (20:26 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 19 Mar 2020 19:36:13 +0000 (20:36 +0100)
Display the status of the certificate in 'show ssl cert'.

Example:

  Status: Empty
  Status: Unused
  Status: Used

src/ssl_sock.c

index 83bbaca093cc2eb3048c4548fe5206b07c88584e..a92f9c9131df7aadedbcdcb10b6ddf620edf68cf 100644 (file)
@@ -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;