]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: ssl/cli: fix build for openssl < 1.0.2
authorWilliam Lallemand <wlallemand@haproxy.com>
Wed, 18 Dec 2019 19:36:01 +0000 (20:36 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Wed, 18 Dec 2019 19:40:20 +0000 (20:40 +0100)
Commit d4f946c ("MINOR: ssl/cli: 'show ssl cert' give information on the
certificates") introduced a build issue with openssl version < 1.0.2
because it uses the certificate bundles.

src/ssl_sock.c

index 568bf3b6e52942d4c77a3791fc3b43a63bb58a01..2d6b003082844117325eea8a9f2ecfdfd6b351c9 100644 (file)
@@ -10200,6 +10200,7 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
                        chunk_appendf(trash, "# transaction\n");
                        if (!ckchs->multi) {
                                chunk_appendf(trash, "*%s\n", ckchs->path);
+#if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
                        } else {
                                chunk_appendf(trash, "*%s:", ckchs->path);
                                for (n = 0; n < SSL_SOCK_NUM_KEYTYPES; n++) {
@@ -10207,6 +10208,7 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
                                                chunk_appendf(trash, " %s.%s\n", ckchs->path, SSL_SOCK_KEYTYPE_NAMES[n]);
                                }
                                chunk_appendf(trash, "\n");
+#endif
                        }
                }
        }
@@ -10221,6 +10223,7 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
                ckchs = ebmb_entry(node, struct ckch_store, node);
                if (!ckchs->multi) {
                        chunk_appendf(trash, "%s\n", ckchs->path);
+#if HA_OPENSSL_VERSION_NUMBER >= 0x1000200fL
                } else {
                        chunk_appendf(trash, "%s:", ckchs->path);
                        for (n = 0; n < SSL_SOCK_NUM_KEYTYPES; n++) {
@@ -10228,6 +10231,7 @@ static int cli_io_handler_show_cert(struct appctx *appctx)
                                        chunk_appendf(trash, " %s.%s", ckchs->path, SSL_SOCK_KEYTYPE_NAMES[n]);
                        }
                        chunk_appendf(trash, "\n");
+#endif
                }
 
                node = ebmb_next(node);