1CURLOPT_SSL_ENABLE_NPN(3)  curl_easy_setopt options  CURLOPT_SSL_ENABLE_NPN(3)
2
3
4

NAME

6       CURLOPT_SSL_ENABLE_NPN - enable NPN
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode  curl_easy_setopt(CURL  *handle,  CURLOPT_SSL_ENABLE_NPN, long
12       npn);
13

DESCRIPTION

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
18       negotiate http2.
19

DEFAULT

21       1, enabled
22

PROTOCOLS

24       HTTP
25

EXAMPLE

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

AVAILABILITY

36       Added in 7.36.0
37

RETURN VALUE

39       Returns  CURLE_OK  if the option is supported, and CURLE_UNKNOWN_OPTION
40       if not.
41

SEE ALSO

43       CURLOPT_SSL_ENABLE_ALPN(3), CURLOPT_SSL_OPTIONS(3),
44
45
46
47libcurl 7.66.0                   May 31, 2017        CURLOPT_SSL_ENABLE_NPN(3)
Impressum