CURLOPT_SSL_ENABLE_ALPN.3 1.2 KB

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