]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: acme: allow 'key' when generating cert
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 6 Nov 2025 13:11:43 +0000 (14:11 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 6 Nov 2025 13:11:43 +0000 (14:11 +0100)
Allow to use the 'key' keyword when 'crt' was generated with both a crt
and a key.

No backport needed.

src/ssl_ckch.c

index 57d4568346dac827940cc33417aeadc2320c77b2..8ff6847c061f89d2c06358027ba0976ed8d318bb 100644 (file)
@@ -4779,9 +4779,9 @@ static int ckch_conf_load_key_or_generate(void *value, char *buf, struct ckch_st
        errno = 0;
        /* if ACME is enabled and the file does not exists, and no key was previously loaded generate the key */
        if (s->conf.acme.id &&
-           (stat(path, &sb) == -1 && errno == ENOENT) &&
-           (!s->data->key)) {
-               s->data->key = acme_gen_tmp_pkey();
+           (stat(path, &sb) == -1 && errno == ENOENT)) {
+               if (!s->data->key)
+                       s->data->key = acme_gen_tmp_pkey();
        } else
 #endif
        {