1--- 2c: Copyright (C) Daniel Stenberg, <daniel.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) 10--- 11 12# NAME 13 14CURLOPT_SSL_ENABLE_NPN - use NPN 15 16# SYNOPSIS 17 18~~~c 19#include <curl/curl.h> 20 21CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_ENABLE_NPN, long npn); 22~~~ 23 24# DESCRIPTION 25 26Deprecated in 7.86.0. Setting this option has no function. 27 28Pass a long as parameter, 0 or 1 where 1 is for enable and 0 for disable. This 29option enables/disables NPN in the SSL handshake (if the SSL backend libcurl 30is built to use supports it), which can be used to negotiate http2. 31 32# DEFAULT 33 341, enabled 35 36# PROTOCOLS 37 38HTTP 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