CURLOPT_PROXY_SSLCERT_BLOB.3 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXY_SSLCERT_BLOB.md
  2. .TH CURLOPT_PROXY_SSLCERT_BLOB 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXY_SSLCERT_BLOB \- SSL proxy client certificate from memory blob
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLCERT_BLOB,
  9. struct curl_blob *blob);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a pointer to a curl_blob structure, which contains information (pointer
  13. and size) about a memory block with binary data of the certificate used to
  14. connect to the HTTPS proxy. The format must be "P12" on Secure Transport or
  15. Schannel. The format must be "P12" or "PEM" on OpenSSL. The string "P12" or
  16. \&"PEM" must be specified with \fICURLOPT_PROXY_SSLCERTTYPE(3)\fP.
  17. If the blob is initialized with the flags member of struct curl_blob set to
  18. CURL_BLOB_COPY, the application does not have to keep the buffer around after
  19. setting this.
  20. This option is an alternative to \fICURLOPT_PROXY_SSLCERT(3)\fP which instead
  21. expects a filename as input.
  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 and Secure Transport
  28. .SH EXAMPLE
  29. .nf
  30. extern char *certificateData; /* point to data */
  31. extern size_t filesize; /* size of the data */
  32. int main(void)
  33. {
  34. CURL *curl = curl_easy_init();
  35. if(curl) {
  36. CURLcode res;
  37. struct curl_blob blob;
  38. blob.data = certificateData;
  39. blob.len = filesize;
  40. blob.flags = CURL_BLOB_COPY;
  41. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  42. curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
  43. curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
  44. curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
  45. curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT_BLOB, &blob);
  46. res = curl_easy_perform(curl);
  47. curl_easy_cleanup(curl);
  48. }
  49. }
  50. .fi
  51. .SH AVAILABILITY
  52. Added in curl 7.71.0
  53. .SH RETURN VALUE
  54. Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or
  55. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  56. .SH SEE ALSO
  57. .BR CURLOPT_PROXY_SSLCERT (3),
  58. .BR CURLOPT_PROXY_SSLCERTTYPE (3),
  59. .BR CURLOPT_PROXY_SSLKEY (3),
  60. .BR CURLOPT_SSLCERT_BLOB (3)