CURLINFO_CAPATH(3)
π CURLINFO_CAPATH β the "where's my default CA folder at" of curl
okay bestie, this is CURLINFO_CAPATH, and it lives in the Library Functions Manual section of the curl universe. it's a curl_easy_getinfo thing, and honestly? kind of a vibe. let's get into it π
β¨ SYNOPSIS β¨
grab the header like the icon you are:
#include <curl/curl.h>
CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CAPATH, char **path);
πΈ DESCRIPTION πΈ
so here's the tea: you pass a pointer to a char pointer, and it comes back holding a pointer to a null-terminated string. that string is the default built-in path used for the CURLOPT_CAPATH(3) option β like, unless the user set their own. iykyk π
β οΈ heads up bestie: if libcurl was built to support multiple TLS libraries, this option might hand you a string even if the specific TLS library currently set to be used does not support CURLOPT_CAPATH(3). so likeβ¦ don't get too comfy with it, ok? π
this is a path identifying a directory. that's it. that's the whole thing. a directory. ποΈ
and if there's no default path? the path pointer gets set to NULL. periodt. NULL. π
π¦ PROTOCOLS π¦
this functionality affects all TLS based protocols β like HTTPS, FTPS, IMAPS, POP3S, SMTPS etc. all of them. the whole squad. π₯
this option works only with the following TLS backends:
- GnuTLS
- OpenSSL
- mbedTLS
- wolfSSL
β EXAMPLE β
here's a lil sample, so you can copy-paste and feel iconic:
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
char *capath = NULL;
curl_easy_getinfo(curl, CURLINFO_CAPATH, &capath);
if(capath) {
printf("default ca path: %s\n", capath);
}
curl_easy_cleanup(curl);
}
}
look at it go π«Ά
π AVAILABILITY π
added in curl 7.84.0 β so if your curl is older than that, sorry bestie, no capath lore for you π
π RETURN VALUE π
curl_easy_getinfo(3) returns a CURLcode β indicating success or error, as one does.
CURLE_OK(0) means everything was OK. slay. β¨- non-zero means an error occurred β peep
libcurl-errors(3)for the deets.
π SEE ALSO π
and that's the whole page, bestie β brought to you by libcurl, dated 2026-10-12, filed under CURLINFO_CAPATH(3). mwah π
π¦ 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