diff --git a/src/client/http/requestmanager/Libcurl.cpp b/src/client/http/requestmanager/Libcurl.cpp index 32978b040..c0f0cfd06 100644 --- a/src/client/http/requestmanager/Libcurl.cpp +++ b/src/client/http/requestmanager/Libcurl.cpp @@ -518,10 +518,6 @@ namespace http HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_CONNECTTIMEOUT, curlConnectTimeoutS)); HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_HTTPHEADER, handle->curlHeaders)); HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_URL, handle->uri.c_str())); - if (proxy.size()) - { - HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_PROXY, proxy.c_str())); - } HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_PRIVATE, (void *)handle)); HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_USERAGENT, userAgent.c_str())); HandleCURLcode(curl_easy_setopt(handle->curlEasy, CURLOPT_HEADERDATA, (void *)handle)); @@ -615,8 +611,10 @@ namespace http HandleCURLcode(curl_easy_setopt(easy, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NO_REVOKE)); #endif - auto &capath = http::RequestManager::Ref().Capath(); - auto &cafile = http::RequestManager::Ref().Cafile(); + auto &rm = http::RequestManager::Ref(); + auto &capath = rm.Capath(); + auto &cafile = rm.Cafile(); + auto &proxy = rm.Proxy(); if (capath.size()) { HandleCURLcode(curl_easy_setopt(easy, CURLOPT_CAPATH, capath.c_str())); @@ -629,5 +627,9 @@ namespace http { UseSystemCertProvider(easy); } + if (proxy.size()) + { + HandleCURLcode(curl_easy_setopt(easy, CURLOPT_PROXY, proxy.c_str())); + } } } diff --git a/src/client/http/requestmanager/RequestManager.h b/src/client/http/requestmanager/RequestManager.h index c55e8f3a0..f0f2dc540 100644 --- a/src/client/http/requestmanager/RequestManager.h +++ b/src/client/http/requestmanager/RequestManager.h @@ -99,6 +99,11 @@ namespace http return capath; } + const ByteString &Proxy() const + { + return proxy; + } + static RequestManagerPtr Create(ByteString newProxy, ByteString newCafile, ByteString newCapath, bool newDisableNetwork); }; }