libcurl has option CURLOPT_HTTP_VERSION with next parameters:
CURL_HTTP_VERSION_2TLS:
Attempt HTTP 2 over TLS (HTTPS) only.
CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE:
Issue non-TLS HTTP requests using HTTP/2
Doesn 't http 2 work automatically with a TLS Connection ? Can http 2 be with an open non - encrypted connection ?