1CURLOPT_SSL_ENABLE_NPN(3) curl_easy_setopt options CURLOPT_SSL_ENABLE_NPN(3)
2
3
4
6 CURLOPT_SSL_ENABLE_NPN - use NPN
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_ENABLE_NPN, long npn);
12
14 Deprecated in 7.86.0. Setting this option has no function.
15
16 Pass a long as parameter, 0 or 1 where 1 is for enable and 0 for dis‐
17 able. This option enables/disables NPN in the SSL handshake (if the SSL
18 backend libcurl is built to use supports it), which can be used to ne‐
19 gotiate http2.
20
22 1, enabled
23
25 HTTP
26
28 CURL *curl = curl_easy_init();
29 if(curl) {
30 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
31 curl_easy_setopt(curl, CURLOPT_SSL_ENABLE_NPN, 1L);
32 ret = curl_easy_perform(curl);
33 curl_easy_cleanup(curl);
34 }
35
37 Added in 7.36.0. Deprecated in 7.86.0.
38
40 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
41 if not.
42
44 CURLOPT_SSL_ENABLE_ALPN(3), CURLOPT_SSL_OPTIONS(3),
45
46
47
48libcurl 8.0.1 January 02, 2023 CURLOPT_SSL_ENABLE_NPN(3)