CURLINFO_CAINFO.3 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .\" generated by cd2nroff 0.1 from CURLINFO_CAINFO.md
  2. .TH CURLINFO_CAINFO 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLINFO_CAINFO \- get the default built\-in CA certificate path
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_CAINFO, char **path);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a pointer to a char pointer to receive the pointer to a null\-terminated
  12. string holding the default built\-in path used for the \fICURLOPT_CAINFO(3)\fP
  13. option unless set by the user.
  14. Note that in a situation where libcurl has been built to support multiple TLS
  15. libraries, this option might return a string even if the specific TLS library
  16. currently set to be used does not support \fICURLOPT_CAINFO(3)\fP.
  17. This is a path identifying a single file containing CA certificates.
  18. The \fBpath\fP pointer is set to NULL if there is no default path.
  19. .SH PROTOCOLS
  20. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  21. All TLS backends support this option.
  22. .SH EXAMPLE
  23. .nf
  24. int main(void)
  25. {
  26. CURL *curl = curl_easy_init();
  27. if(curl) {
  28. char *cainfo = NULL;
  29. curl_easy_getinfo(curl, CURLINFO_CAINFO, &cainfo);
  30. if(cainfo) {
  31. printf("default ca info path: %s\\n", cainfo);
  32. }
  33. curl_easy_cleanup(curl);
  34. }
  35. }
  36. .fi
  37. .SH AVAILABILITY
  38. Added in curl 7.84.0
  39. .SH RETURN VALUE
  40. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  41. .SH SEE ALSO
  42. .BR CURLINFO_CAPATH (3),
  43. .BR curl_easy_getinfo (3),
  44. .BR curl_easy_setopt (3)