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

NAME

6       CURLOPT_SSL_ENABLE_ALPN - Application Layer Protocol Negotiation
7

SYNOPSIS

9       #include <curl/curl.h>
10
11       CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_ENABLE_ALPN, 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 ALPN in the SSL  handshake  (if  the
16       SSL  backend libcurl is built to use supports it), which can be used to
17       negotiate 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_ALPN, 0L);
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_NPN(3), CURLOPT_SSL_OPTIONS(3),
43
44
45
46libcurl 7.85.0                   May 17, 2022       CURLOPT_SSL_ENABLE_ALPN(3)
Impressum