CURLOPT_PROXY_SSLCERT.3 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXY_SSLCERT.md
  2. .TH CURLOPT_PROXY_SSLCERT 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXY_SSLCERT \- HTTPS proxy client certificate
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSLCERT, char *cert);
  9. .fi
  10. .SH DESCRIPTION
  11. This option is for connecting to an HTTPS proxy, not an HTTPS server.
  12. Pass a pointer to a null\-terminated string as parameter. The string should be
  13. the filename of your client certificate used to connect to the HTTPS proxy.
  14. The default format is "P12" on Secure Transport and "PEM" on other engines,
  15. and can be changed with \fICURLOPT_PROXY_SSLCERTTYPE(3)\fP.
  16. With Secure Transport, this can also be the nickname of the certificate you
  17. wish to authenticate with as it is named in the security database. If you want
  18. to use a file from the current directory, please precede it with "./" prefix,
  19. in order to avoid confusion with a nickname.
  20. When using a client certificate, you most likely also need to provide a
  21. private key with \fICURLOPT_PROXY_SSLKEY(3)\fP.
  22. The application does not have to keep the string around after setting this
  23. option.
  24. .SH DEFAULT
  25. NULL
  26. .SH PROTOCOLS
  27. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  28. This option works only with the following TLS backends:
  29. GnuTLS, OpenSSL, Schannel, Secure Transport, mbedTLS and wolfSSL
  30. .SH EXAMPLE
  31. .nf
  32. int main(void)
  33. {
  34. CURL *curl = curl_easy_init();
  35. if(curl) {
  36. CURLcode res;
  37. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  38. curl_easy_setopt(curl, CURLOPT_PROXY, "https://proxy");
  39. curl_easy_setopt(curl, CURLOPT_PROXY_SSLCERT, "client.pem");
  40. curl_easy_setopt(curl, CURLOPT_PROXY_SSLKEY, "key.pem");
  41. curl_easy_setopt(curl, CURLOPT_PROXY_KEYPASSWD, "s3cret");
  42. res = curl_easy_perform(curl);
  43. curl_easy_cleanup(curl);
  44. }
  45. }
  46. .fi
  47. .SH AVAILABILITY
  48. Added in curl 7.52.0
  49. .SH RETURN VALUE
  50. Returns CURLE_OK if TLS enabled, CURLE_UNKNOWN_OPTION if not, or
  51. CURLE_OUT_OF_MEMORY if there was insufficient heap space.
  52. .SH SEE ALSO
  53. .BR CURLOPT_PROXY_SSLCERTTYPE (3),
  54. .BR CURLOPT_PROXY_SSLKEY (3),
  55. .BR CURLOPT_SSLCERT (3)