CURLOPT_PROXY_SSLKEY_BLOB.3 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXY_SSLKEY_BLOB.md
  2. .TH CURLOPT_PROXY_SSLKEY_BLOB 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXY_SSLKEY_BLOB \- private key for proxy cert from memory blob
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLKEY_BLOB,
  9. struct curl_blob *blob);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a pointer to a curl_blob structure that contains information (pointer and
  13. size) about the private key for connecting to the HTTPS proxy. Compatible with
  14. OpenSSL. The format (like "PEM") must be specified with
  15. \fICURLOPT_PROXY_SSLKEYTYPE(3)\fP.
  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. .SH DEFAULT
  20. NULL
  21. .SH PROTOCOLS
  22. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  23. This option works only with the following TLS backends:
  24. OpenSSL
  25. .SH EXAMPLE
  26. .nf
  27. extern char *certificateData; /* point to data */
  28. extern size_t filesize; /* size of data */
  29. extern char *privateKeyData; /* point to data */
  30. extern size_t privateKeySize; /* size */
  31. int main(void)
  32. {
  33. CURL *curl = curl_easy_init();
  34. if(curl) {
  35. CURLcode res;
  36. struct curl_blob blob;
  37. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  38. curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
  39. blob.data = certificateData;
  40. blob.len = filesize;
  41. blob.flags = CURL_BLOB_COPY;
  42. curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT_BLOB, &blob);
  43. curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERTTYPE, "PEM");
  44. blob.data = privateKeyData;
  45. blob.len = privateKeySize;
  46. curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY_BLOB, &blob);
  47. curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
  48. res = curl_easy_perform(curl);
  49. curl_easy_cleanup(curl);
  50. }
  51. }
  52. .fi
  53. .SH AVAILABILITY
  54. Added in curl 7.71.0
  55. .SH RETURN VALUE
  56. Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or
  57. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  58. .SH SEE ALSO
  59. .BR CURLOPT_SSLKEY (3),
  60. .BR CURLOPT_SSLKEYTYPE (3),
  61. .BR CURLOPT_SSLKEY_BLOB (3)