GNURLOPT_SSL_ENABLE_ALPN(3)

πŸ“¦ version 7.72.0, in nixos 26.05, nixpkgs unstable

πŸŽ€ GNURLOPT_SSL_ENABLE_ALPN(3) πŸŽ€

okay bestie, welcome to the GNURLOPT_SSL_ENABLE_ALPN(3) manual page β€” it's one of the curl_easy_setopt options and it's here to explain ALPN enable/disable vibes. πŸ’…

✨ NAME ✨

CURLOPT_SSL_ENABLE_ALPN β€” enable ALPN. That's the whole name vibe, no cap.

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnurl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_ENABLE_ALPN, long
npn);

🌸 DESCRIPTION 🌸

You pass a long as the parameter, bestie β€” 0 or 1, where 1 is for enable and 0 is for disable. This option enables/disables ALPN in the SSL handshake (if the SSL backend libcurl is built to use supports it), which can be used to negotiate http2. Iconic behavior honestly. ✨

πŸ’– DEFAULT πŸ’–

1, enabled. So it's on by default β€” main character energy. πŸ‘‘

🌈 PROTOCOLS 🌈

This one's for HTTP, bestie. 🌈

πŸ“ EXAMPLE πŸ“

Here's the example, copied exactly because we do not mess with code: πŸ“

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  curl_easy_setopt(curl, CURLOPT_SSL_ENABLE_ALPN, 0L);
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

⭐ AVAILABILITY ⭐

Added in 7.36.0. Periodt.

🫢 RETURN VALUE 🫢

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. That's the whole return-value tea. β˜•

πŸ‘‘ SEE ALSO πŸ‘‘


Cute sign-off: source/version libcurl 7.37.0, date 19 Jun 2014 β€” mwah πŸ’‹, bye bestie! 🧚

πŸ“¦ where this page comes from