aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanie sappho lenzo <sappho@sappho.io>2023-12-05 13:21:22 -0500
committerstephanie sappho lenzo <sappho@sappho.io>2023-12-05 13:21:22 -0500
commitf511b48dc85d9991f0f656defba79b3d36bba491 (patch)
tree6d4e1701cbbe166072929d51e815176ee49c4c9a
parent26dbc7e9208fcc91530d94ad8389953e147d7e6e (diff)
use system ssl certs
-rw-r--r--extension/curlmanager.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/extension/curlmanager.cpp b/extension/curlmanager.cpp
index 6a64c10..3cf127b 100644
--- a/extension/curlmanager.cpp
+++ b/extension/curlmanager.cpp
@@ -714,6 +714,23 @@ void cURLManager::LoadcURLOption(cURLHandle *handle)
handle->opt_loaded = true;
+ static bool curlSetSSL = false;
+ if (!curlSetSSL)
+ {
+ // use the system ssl certs
+ CURLsslset sslset = curl_global_sslset(CURLSSLBACKEND_OPENSSL, NULL, NULL);
+ if (sslset != CURLSSLSET_OK)
+ {
+ printf("curl_global_sslset failed: %i\n", sslset);
+ return;
+ }
+ curlSetSSL = true;
+ }
+
+
+ curl_easy_setopt(handle->curl, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
+ curl_easy_setopt(handle->curl, CURLOPT_ACCEPT_ENCODING, "");
+
curl_easy_setopt(handle->curl, CURLOPT_ERRORBUFFER, handle->errorBuffer);
curl_easy_setopt(handle->curl, CURLOPT_OPENSOCKETFUNCTION, curl_opensocket_function);