From 31896e1122ac28fefc5ac29550de378194fa4e3e Mon Sep 17 00:00:00 2001 From: Mykhailo Kuchma Date: Fri, 18 Apr 2025 15:53:39 +0200 Subject: [PATCH] Change NetworkCurl Make sure we are using http2 when it's possible Relates-To: OCMAM-502 Signed-off-by: Mykhailo Kuchma --- olp-cpp-sdk-core/src/http/curl/NetworkCurl.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/olp-cpp-sdk-core/src/http/curl/NetworkCurl.cpp b/olp-cpp-sdk-core/src/http/curl/NetworkCurl.cpp index 7590296f2..cc5bcfd50 100644 --- a/olp-cpp-sdk-core/src/http/curl/NetworkCurl.cpp +++ b/olp-cpp-sdk-core/src/http/curl/NetworkCurl.cpp @@ -718,6 +718,9 @@ ErrorCode NetworkCurl::SendImplementation( curl_easy_setopt(curl_handle, CURLOPT_VERBOSE, 0L); } + // Request HTTP/2 when supported by the server (via ALPN negotiation) + curl_easy_setopt(curl_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); + curl_easy_setopt(curl_handle, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2); const std::string& url = request.GetUrl();