CURLOPT_PROXY_CAINFO_BLOB.3 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXY_CAINFO_BLOB.md
  2. .TH CURLOPT_PROXY_CAINFO_BLOB 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXY_CAINFO_BLOB \- proxy Certificate Authority (CA) bundle in PEM format
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_CAINFO_BLOB,
  9. struct curl_blob *stblob);
  10. .fi
  11. .SH DESCRIPTION
  12. This option is for connecting to an HTTPS proxy, not an HTTPS server.
  13. Pass a pointer to a curl_blob structure, which contains information (pointer
  14. and size) about a memory block with binary data of PEM encoded content holding
  15. one or more certificates to verify the HTTPS proxy with.
  16. If the blob is initialized with the flags member of struct curl_blob set to
  17. CURL_BLOB_COPY, the application does not have to keep the buffer around after
  18. setting this.
  19. If \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP is zero and you avoid verifying the
  20. server\(aqs certificate, \fICURLOPT_PROXY_CAINFO_BLOB(3)\fP is not needed.
  21. This option overrides \fICURLOPT_PROXY_CAINFO(3)\fP.
  22. .SH DEFAULT
  23. NULL
  24. .SH PROTOCOLS
  25. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  26. This option works only with the following TLS backends:
  27. OpenSSL, Schannel, Secure Transport and rustls
  28. .SH EXAMPLE
  29. .nf
  30. #include <string.h> /* for strlen */
  31. extern char *strpem; /* strpem must point to a PEM string */
  32. int main(void)
  33. {
  34. CURL *curl = curl_easy_init();
  35. if(curl) {
  36. CURLcode res;
  37. struct curl_blob blob;
  38. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  39. /* using an HTTPS proxy */
  40. curl_easy_setopt(curl, CURLOPT_PROXY, "https://localhost:443");
  41. blob.data = strpem;
  42. blob.len = strlen(strpem);
  43. blob.flags = CURL_BLOB_COPY;
  44. curl_easy_setopt(curl, CURLOPT_PROXY_CAINFO_BLOB, &blob);
  45. res = curl_easy_perform(curl);
  46. curl_easy_cleanup(curl);
  47. }
  48. }
  49. .fi
  50. .SH AVAILABILITY
  51. Added in curl 7.77.0
  52. .SH RETURN VALUE
  53. Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
  54. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  55. .SH SEE ALSO
  56. .BR CURLOPT_CAINFO (3),
  57. .BR CURLOPT_CAINFO_BLOB (3),
  58. .BR CURLOPT_CAPATH (3),
  59. .BR CURLOPT_PROXY_CAINFO (3),
  60. .BR CURLOPT_PROXY_CAPATH (3),
  61. .BR CURLOPT_PROXY_SSL_VERIFYHOST (3),
  62. .BR CURLOPT_PROXY_SSL_VERIFYPEER (3),
  63. .BR CURLOPT_SSL_VERIFYHOST (3),
  64. .BR CURLOPT_SSL_VERIFYPEER (3)