CURLOPT_HSTSREADDATA(3)
π CURLOPT_HSTSREADDATA(3) β the pointer you hand to your HSTS read callback
Okay bestie, welcome to another libcurl manual page, this one lives in the Library Functions Manual and it's all about CURLOPT_HSTSREADDATA β the little data pointer that gets passed to your HSTS read callback. π
β¨ NAME β¨
CURLOPT_HSTSREADDATA β pointer passed to the HSTS read callback. that's it, that's the whole vibe.
πΈ SYNOPSIS πΈ
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HSTSREADDATA, void *pointer);
π¦ DESCRIPTION π¦
So picture this: it's a data pointer that you pass along to the HSTS read function. If you're using the CURLOPT_HSTSREADFUNCTION(3) option, this is literally the pointer you get as input in the 3rd argument to that callback. no middleman, no extra steps, it just shows up there. π
β οΈ okay important thing, don't skip this: setting this option does not enable HSTS. like, at all. you need CURLOPT_HSTS_CTRL(3) for that, fr fr. this option is just the lil package you hand over, not the switch that turns stuff on. π
π§ DEFAULT π§
NULL
π PROTOCOLS π
This functionality affects http only. that's the whole list, she's exclusive like that. π
π EXAMPLE π
struct MyData {
void *custom;
};
int main(void)
{
CURL *curl = curl_easy_init();
struct MyData this;
if(curl) {
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
/* pass pointer that gets passed in to the
CURLOPT_HSTSREADFUNCTION callback */
curl_easy_setopt(curl, CURLOPT_HSTSREADDATA, &this);
curl_easy_perform(curl);
}
}
see how &this just gets yeeted into the callback later? iconic behavior honestly. β¨
β AVAILABILITY β
Added in curl 7.74.0 β so if your curl is older than that, she doesn't know this option yet, sorry bestie. π
π RETURN VALUE π
This returns CURLE_OK. that's it. no drama, no surprises, just a clean little success. π«Ά
π₯ SEE ALSO π₯
okay that's the whole page, go forth and pass your pointers responsibly π β¨
mwah π β this gem was brought to you by the fine folks of libcurl, dated 2026-10-12, and yes she's official, in the Library Functions Manual, CURLOPT_HSTSREADDATA(3) and all. slay. π
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms