Skip to content

Commit

Permalink
check cert_store pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Jun 5, 2024
1 parent b1f3961 commit 325aaa4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tls/openssl/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -1997,8 +1997,10 @@ int tls_add_certf(struct tls *tls, const char *certf, const char *host)
goto err;

X509_STORE *ca = SSL_CTX_get_cert_store(tls->ctx);
X509_STORE_up_ref(ca);
SSL_CTX_set_cert_store(uc->ctx, ca);
if (ca) {
X509_STORE_up_ref(ca);
SSL_CTX_set_cert_store(uc->ctx, ca);
}

list_append(&tls->certs, &uc->le, uc);
if (list_count(&tls->certs) == 1)
Expand Down

0 comments on commit 325aaa4

Please sign in to comment.