CURLOPT_PROXY_CAINFO.3 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXY_CAINFO.md
  2. .TH CURLOPT_PROXY_CAINFO 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXY_CAINFO \- path to proxy Certificate Authority (CA) bundle
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAINFO, char *path);
  9. .fi
  10. .SH DESCRIPTION
  11. This option is for connecting to an HTTPS proxy, not an HTTPS server.
  12. Pass a char pointer to a null\-terminated string naming a file holding one or
  13. more certificates to verify the HTTPS proxy with.
  14. If \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP is zero and you avoid verifying the
  15. server\(aqs certificate, \fICURLOPT_PROXY_CAINFO(3)\fP need not even indicate an
  16. accessible file.
  17. This option is by default set to the system path where libcurl\(aqs CA
  18. certificate bundle is assumed to be stored, as established at build time.
  19. (iOS and macOS only) If curl is built against Secure Transport, then this
  20. option is supported for backward compatibility with other SSL engines, but it
  21. should not be set. If the option is not set, then curl uses the certificates
  22. in the system and user Keychain to verify the peer, which is the preferred
  23. method of verifying the peer\(aqs certificate chain.
  24. The application does not have to keep the string around after setting this
  25. option.
  26. The default value for this can be figured out with \fICURLINFO_CAINFO(3)\fP.
  27. .SH DEFAULT
  28. Built\-in system specific
  29. .SH PROTOCOLS
  30. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  31. All TLS backends support this option.
  32. .SH EXAMPLE
  33. .nf
  34. int main(void)
  35. {
  36. CURL *curl = curl_easy_init();
  37. if(curl) {
  38. CURLcode res;
  39. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  40. /* using an HTTPS proxy */
  41. curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
  42. curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO, "/etc/certs/cabundle.pem");
  43. res = curl_easy_perform(curl);
  44. curl_easy_cleanup(curl);
  45. }
  46. }
  47. .fi
  48. .SH NOTES
  49. For TLS backends that do not support certificate files, the
  50. \fICURLOPT_PROXY_CAINFO(3)\fP option is ignored. Refer to
  51. https://curl.se/docs/ssl\-compared.html
  52. .SH AVAILABILITY
  53. Added in curl 7.52.0
  54. .SH RETURN VALUE
  55. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  56. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  57. .SH SEE ALSO
  58. .BR CURLOPT_CAINFO (3),
  59. .BR CURLOPT_CAINFO_BLOB (3),
  60. .BR CURLOPT_CAPATH (3),
  61. .BR CURLOPT_PROXY_CAINFO_BLOB (3),
  62. .BR CURLOPT_PROXY_CAPATH (3),
  63. .BR CURLOPT_PROXY_SSL_VERIFYHOST (3),
  64. .BR CURLOPT_PROXY_SSL_VERIFYPEER (3),
  65. .BR CURLOPT_SSL_VERIFYHOST (3),
  66. .BR CURLOPT_SSL_VERIFYPEER (3)