You've already forked cpp-httplib
Fix #2217
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user