Skip to content

Conversation

@lalitb
Copy link
Contributor

@lalitb lalitb commented Nov 8, 2022

Small change to add HTTP/2 support to HTTPClient_curl. It will fallback to HTTP/1.1 if either of client or server doesn't support HTTP/2.

curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0); // 1L
curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0); // 2L
// HTTP/2 please, fallback to HTTP/1.1 if not supported
curl_easy_setopt(curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new line of API call says using version 2.0, will it fallback automatically, or any extra parameter needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it will fallback automatically to using HTTP/1.1 if

  • curl is built without the nghttp2 library.
  • the collector is not supporting HTTP/2.0

@lalitb lalitb merged commit 0177277 into main Mar 30, 2023
@lalitb lalitb deleted the curl-http2-support branch March 30, 2023 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants