CURLOPT_GSSAPI_DELEGATION(3)

πŸ’… CURLOPT_GSSAPI_DELEGATION β€” like, the allowed GSS-API delegation one πŸŽ€

Okay bestie, so this is a page from the libcurl manual (the Library Functions Manual, if we're being fancy ✨) and it's all about CURLOPT_GSSAPI_DELEGATION β€” which is, literally, the allowed GSS-API delegation setting. No cap. πŸ¦‹


✨ SYNOPSIS ✨

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_GSSAPI_DELEGATION, long level);

πŸ’– DESCRIPTION πŸ’–

So you set that long parameter level, right? And here's the vibe check on what you can put in it πŸ‘‡

  • Set it to CURLGSSAPI_DELEGATION_FLAG and you get unconditional GSSAPI credential delegation. Like, no questions asked, delegation is ON. πŸ’…
  • Delegation is disabled by default β€” and it's been that way since 7.21.7, so don't come for me, that's just how it is. 🫢
  • Set the parameter to CURLGSSAPI_DELEGATION_POLICY_FLAG and it'll only delegate if the OK-AS-DELEGATE flag is set in the service ticket β€” but only in case this feature is supported by the GSS-API implementation and the definition of GSS_C_DELEG_POLICY_FLAG was available at compile-time. Conditional queen behavior, honestly. πŸ‘‘

πŸŽ€ DEFAULT πŸŽ€

CURLGSSAPI_DELEGATION_NONE

(the delegation stays home, bestie 😌)


🌈 PROTOCOLS 🌈

This functionality affects http only. That's it. That's the whole list. πŸ’€


πŸ”₯ EXAMPLE πŸ”₯

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    CURLcode result;
    curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
    /* delegate if okayed by policy */
    curl_easy_setopt(curl, CURLOPT_GSSAPI_DELEGATION,
                     CURLGSSAPI_DELEGATION_POLICY_FLAG);
    result = curl_easy_perform(curl);
  }
}

Not me writing a whole main just to show off a flag 😭 β€” but like, look at it. It ate. πŸ“


🧚 HISTORY 🧚

Okay so there was a glow-up ✨: the CURLGSSAPI_DELEGATION_* macros became long types in 8.16.0. Prior to that version, a long cast was necessary when you passed them to curl_easy_setopt(3). So if you're on old curl, cast it or perish πŸ™ˆ.


⭐ AVAILABILITY ⭐

Added in curl 7.22.0. She's been around a minute, ngl. πŸ’œ


πŸ‘‘ RETURN VALUE πŸ‘‘

curl_easy_setopt(3) returns a CURLcode indicating success or error.

  • CURLE_OK (0) means everything was OK β€” slay. 🌸
  • non-zero means an error occurred β€” and you can look it up in libcurl-errors(3).

πŸ¦‹ SEE ALSO πŸ¦‹


Lowkey a whole delegation policy discourse in one tiny manpage β€” read it, love it, set your flags responsibly, bestie. πŸ’–

Alright that's the page! Signing off with a big kiss from the libcurl crew, dated 2026-10-12, and yes this was CURLOPT_GSSAPI_DELEGATION(3) the whole time β€” iykyk πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from