mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
BUG/MINOR: ssl: fix SSL_CTX_set1_chain compatibility for openssl < 1.0.2
Commit1c65fdd5
"MINOR: ssl: add extra chain compatibility" really implement SSL_CTX_set0_chain. Since ckch can be used to init more than one ctx with openssl < 1.0.2 (commit89f58073
for X509_chain_up_ref compatibility), SSL_CTX_set1_chain compatibility is required. This patch must be backported to 2.1.
This commit is contained in:
parent
6ab08b3fd4
commit
140b64fb56
@ -3552,11 +3552,14 @@ static int ssl_sock_put_ckch_into_ctx(const char *path, const struct cert_key_an
|
|||||||
#else
|
#else
|
||||||
{ /* legacy compat (< openssl 1.0.2) */
|
{ /* legacy compat (< openssl 1.0.2) */
|
||||||
X509 *ca;
|
X509 *ca;
|
||||||
while ((ca = sk_X509_shift(ckch->chain)))
|
STACK_OF(X509) *chain;
|
||||||
|
chain = X509_chain_up_ref(ckch->chain);
|
||||||
|
while ((ca = sk_X509_shift(chain)))
|
||||||
if (!SSL_CTX_add_extra_chain_cert(ctx, ca)) {
|
if (!SSL_CTX_add_extra_chain_cert(ctx, ca)) {
|
||||||
memprintf(err, "%sunable to load chain certificate into SSL Context '%s'.\n",
|
memprintf(err, "%sunable to load chain certificate into SSL Context '%s'.\n",
|
||||||
err && *err ? *err : "", path);
|
err && *err ? *err : "", path);
|
||||||
X509_free(ca);
|
X509_free(ca);
|
||||||
|
sk_X509_pop_free(chain, X509_free);
|
||||||
errcode |= ERR_ALERT | ERR_FATAL;
|
errcode |= ERR_ALERT | ERR_FATAL;
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user