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

NAME

6       CURLOPT_SSL_ENABLE_NPN - use NPN
7

SYNOPSIS

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

DESCRIPTION

14       Pass  a  long as parameter, 0 or 1 where 1 is for enable and 0 for dis‐
15       able. This option enables/disables NPN in the SSL handshake (if the SSL
16       backend  libcurl is built to use supports it), which can be used to ne‐
17       gotiate http2.
18

DEFAULT

20       1, enabled
21

PROTOCOLS

23       HTTP
24

EXAMPLE

26       CURL *curl = curl_easy_init();
27       if(curl) {
28         curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
29         curl_easy_setopt(curl, CURLOPT_SSL_ENABLE_NPN, 1L);
30         ret = curl_easy_perform(curl);
31         curl_easy_cleanup(curl);
32       }
33

AVAILABILITY

35       Added in 7.36.0
36

RETURN VALUE

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

SEE ALSO

42       CURLOPT_SSL_ENABLE_ALPN(3), CURLOPT_SSL_OPTIONS(3),
43
44
45
46libcurl 7.82.0                 November 26, 2021     CURLOPT_SSL_ENABLE_NPN(3)
Impressum