1
0
mirror of synced 2025-09-08 13:12:06 +03:00
This commit is contained in:
yhirose
2025-08-29 15:01:59 -04:00
parent 7a3b92bbd9
commit eb5a65e0df
2 changed files with 44 additions and 1 deletions

View File

@@ -8984,7 +8984,9 @@ inline bool ClientImpl::create_redirect_client(
}
// Handle CA certificate store and paths if available
if (ca_cert_store_) { redirect_client.set_ca_cert_store(ca_cert_store_); }
if (ca_cert_store_ && X509_STORE_up_ref(ca_cert_store_)) {
redirect_client.set_ca_cert_store(ca_cert_store_);
}
if (!ca_cert_file_path_.empty()) {
redirect_client.set_ca_cert_path(ca_cert_file_path_, ca_cert_dir_path_);
}
@@ -10878,6 +10880,7 @@ inline void SSLClient::set_ca_cert_store(X509_STORE *ca_cert_store) {
if (SSL_CTX_get_cert_store(ctx_) != ca_cert_store) {
// Free memory allocated for old cert and use new store `ca_cert_store`
SSL_CTX_set_cert_store(ctx_, ca_cert_store);
ca_cert_store_ = ca_cert_store;
}
} else {
X509_STORE_free(ca_cert_store);