GNURLOPT_SSL_ENABLE_NPN(3)

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

πŸ’– GNURLOPT_SSL_ENABLE_NPN(3) πŸ’–

okay bestie, quick vibe check: this page is from the <pink>curl_easy_setopt options</pink> manual, and the main character is CURLOPT_SSL_ENABLE_NPN. no cap.

✨ NAME ✨

CURLOPT_SSL_ENABLE_NPN β€” enable NPN. concise, iconic, slay πŸ’….

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gnurl/curl.h>

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

🌸 DESCRIPTION 🌸

So you pass a long as the parameter, and it's either 0 or 1: 1 is for enable, 0 is for disable. lowkey simple.

This option enables/disables NPN in the SSL handshake β€” but only if the SSL backend libcurl is built to use supports it, bestie, that part matters β€” and it can be used to negotiate http2. periodt.

πŸŽ€ DEFAULT πŸŽ€

1, enabled β€” it's on by default, highkey generous.

πŸ¦‹ PROTOCOLS πŸ¦‹

HTTP β€” that's the protocol list, just the one.

🌈 EXAMPLE 🌈

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

⭐ AVAILABILITY ⭐

Added in 7.36.0. vintage but still cute.

πŸ’œ RETURN VALUE πŸ’œ

Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not. that's the whole tea.

🫢 SEE ALSO 🫢


and yeah, signing off from libcurl 7.37.0, dated 19 Jun 2014 β€” GNURLOPT_SSL_ENABLE_NPN(3) out πŸ’–

πŸ“¦ where this page comes from