1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_SSL_ENABLE_NPN
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_SSL_ENABLE_ALPN (3)
9  - CURLOPT_SSL_OPTIONS (3)
10Protocol:
11  - TLS
12TLS-backend:
13  - All
14---
15
16# NAME
17
18CURLOPT_SSL_ENABLE_NPN - use NPN
19
20# SYNOPSIS
21
22~~~c
23#include <curl/curl.h>
24
25CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_ENABLE_NPN, long npn);
26~~~
27
28# DESCRIPTION
29
30Deprecated in 7.86.0. Setting this option has no function.
31
32Pass a long as parameter, 0 or 1 where 1 is for enable and 0 for disable. This
33option enables/disables NPN in the SSL handshake (if the SSL backend libcurl
34is built to use supports it), which can be used to negotiate http2.
35
36# DEFAULT
37
381, enabled
39
40# EXAMPLE
41
42~~~c
43int main(void)
44{
45  CURL *curl = curl_easy_init();
46  if(curl) {
47    CURLcode res;
48    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
49    curl_easy_setopt(curl, CURLOPT_SSL_ENABLE_NPN, 1L);
50    res = curl_easy_perform(curl);
51    curl_easy_cleanup(curl);
52  }
53}
54~~~
55
56# AVAILABILITY
57
58Added in 7.36.0. Deprecated in 7.86.0.
59
60# RETURN VALUE
61
62Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
63