CURLOPT_SSL_ENABLE_NPN.3 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. .\" generated by cd2nroff 0.1 from CURLOPT_SSL_ENABLE_NPN.md
  2. .TH CURLOPT_SSL_ENABLE_NPN 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_SSL_ENABLE_NPN \- use NPN
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_ENABLE_NPN, long npn);
  9. .fi
  10. .SH DESCRIPTION
  11. Deprecated since 7.86.0. Setting this option has no function.
  12. Pass a long as parameter, 0 or 1 where 1 is for enable and 0 for disable. This
  13. option enables/disables NPN in the SSL handshake (if the SSL backend libcurl
  14. is built to use supports it), which can be used to negotiate http2.
  15. .SH DEFAULT
  16. 1, enabled
  17. .SH PROTOCOLS
  18. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  19. All TLS backends support this option.
  20. .SH EXAMPLE
  21. .nf
  22. int main(void)
  23. {
  24. CURL *curl = curl_easy_init();
  25. if(curl) {
  26. CURLcode res;
  27. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  28. curl_easy_setopt(curl, CURLOPT_SSL_ENABLE_NPN, 1L);
  29. res = curl_easy_perform(curl);
  30. curl_easy_cleanup(curl);
  31. }
  32. }
  33. .fi
  34. .SH DEPRECATED
  35. Deprecated since 7.86.0.
  36. .SH AVAILABILITY
  37. Added in curl 7.36.0
  38. .SH RETURN VALUE
  39. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  40. .SH SEE ALSO
  41. .BR CURLOPT_SSL_ENABLE_ALPN (3),
  42. .BR CURLOPT_SSL_OPTIONS (3)