GNURLOPT_SSL_ENABLE_NPN(3)
π 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
- nixos 26.05: libgnurl 7.72.0
- nixpkgs unstable: libgnurl 7.72.0
- Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms