1CURLINFO_CAINFO(3) curl_easy_getinfo options CURLINFO_CAINFO(3)
2
3
4
6 CURLINFO_CAINFO - get the default built-in CA certificate path
7
9 #include <curl/curl.h>
10
11 CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CAINFO, char **path);
12
14 Pass a pointer to a char pointer to receive the pointer to a null-ter‐
15 minated string holding the default built-in path used for the CUR‐
16 LOPT_CAINFO(3) option unless set by the user.
17
18 Note that in a situation where libcurl has been built to support multi‐
19 ple TLS libraries, this option might return a string even if the spe‐
20 cific TLS library currently set to be used does not support CUR‐
21 LOPT_CAINFO(3).
22
23 This is a path identifying a single file containing CA certificates.
24
25 The path pointer will be NULL if there is no default path.
26
28 All
29
31 CURL *curl = curl_easy_init();
32 if(curl) {
33 CURLcode res;
34 char *cainfo = NULL;
35 curl_easy_getinfo(curl, CURLINFO_CAINFO, &cainfo);
36 if(cainfo)
37 printf("default ca info path: %s\n", cainfo);
38 }
39 curl_easy_cleanup(curl);
40 }
41
43 Added in 7.84.0
44
46 Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION
47 if not.
48
50 CURLINFO_CAPATH(3), curl_easy_getinfo(3), curl_easy_setopt(3),
51
52
53
54libcurl 8.0.1 January 02, 2023 CURLINFO_CAINFO(3)