cURL / Mailing Lists / curl-library / Single Mail


HTTP2: how to know the HTTP version used by libcurl

From: Ganesh Nikam <>
Date: Tue, 26 Apr 2016 12:07:38 +0530

Hi All,

We want to use libcurl with HTTP/2 support. As per the details
regarding CURL_HTTP_VERSION_2_0
(, libcurl will
attempt to send HTTP/2 request using upgrade header. But if server is not
supporting HTTP/2, then it will fall back to HTTP 1.1 version. For HTTPS
requests the protocol negotiation will happen using ALPN. As per my
understanding the "fall back" mechanism for HTTP and ALPN for HTTPS are
internal to the libcurl. Application using libcurl will not have any idea
about this. I have some queries on these:

1. Is there any way to know the current HTTP version getting used in
libcurl requests ? I checked getinfo parameters but there is not parameter
for HTTP version ? In our application we want to know HTTP version getting
used for current requests.

2. If we have can send HTTPS requests by setting http version to
then what is the purpose of CURL_HTTP_VERSION_2TLS ?

Ganesh Nikam

List admin:
Received on 2016-04-26