1CURLOPT_SSL_ENABLE_NPN(3) curl_easy_setopt options CURLOPT_SSL_ENABLE_NPN(3)
2
3
4
6 CURLOPT_SSL_ENABLE_NPN - enable NPN
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_ENABLE_NPN, long
12 npn);
13
15 Pass a long as parameter, 0 or 1 where 1 is for enable and 0 for dis‐
16 able. This option enables/disables NPN in the SSL handshake (if the SSL
17 backend libcurl is built to use supports it), which can be used to ne‐
18 gotiate http2.
19
21 1, enabled
22
24 HTTP
25
27 CURL *curl = curl_easy_init();
28 if(curl) {
29 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
30 curl_easy_setopt(curl, CURLOPT_SSL_ENABLE_NPN, 1L);
31 ret = curl_easy_perform(curl);
32 curl_easy_cleanup(curl);
33 }
34
36 Added in 7.36.0
37
39 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
40 if not.
41
43 CURLOPT_SSL_ENABLE_ALPN(3), CURLOPT_SSL_OPTIONS(3),
44
45
46
47libcurl 7.76.1 November 04, 2020 CURLOPT_SSL_ENABLE_NPN(3)