CURLOPT_PROXY_SSL_VERIFYPEER.3 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXY_SSL_VERIFYPEER.md
  2. .TH CURLOPT_PROXY_SSL_VERIFYPEER 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXY_SSL_VERIFYPEER \- verify the proxy\(aqs SSL certificate
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSL_VERIFYPEER,
  9. long verify);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a long as parameter set to 1L to enable or 0L to disable.
  13. This option tells curl to verify the authenticity of the HTTPS proxy\(aqs
  14. certificate. A value of 1 means curl verifies; 0 (zero) means it does not.
  15. This is the proxy version of \fICURLOPT_SSL_VERIFYPEER(3)\fP that is used for
  16. ordinary HTTPS servers.
  17. When negotiating a TLS or SSL connection, the server sends a certificate
  18. indicating its identity. Curl verifies whether the certificate is authentic,
  19. i.e. that you can trust that the server is who the certificate says it is.
  20. This trust is based on a chain of digital signatures, rooted in certification
  21. authority (CA) certificates you supply. curl uses a default bundle of CA
  22. certificates (the path for that is determined at build time) and you can
  23. specify alternate certificates with the \fICURLOPT_PROXY_CAINFO(3)\fP option or
  24. the \fICURLOPT_PROXY_CAPATH(3)\fP option.
  25. When \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP is enabled, and the verification
  26. fails to prove that the certificate is authentic, the connection fails. When
  27. the option is zero, the peer certificate verification succeeds regardless.
  28. Authenticating the certificate is not enough to be sure about the server. You
  29. typically also want to ensure that the server is the server you mean to be
  30. talking to. Use \fICURLOPT_PROXY_SSL_VERIFYHOST(3)\fP for that. The check that the
  31. hostname in the certificate is valid for the hostname you are connecting to is
  32. done independently of the \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP option.
  33. WARNING: disabling verification of the certificate allows bad guys to
  34. man\-in\-the\-middle the communication without you knowing it. Disabling
  35. verification makes the communication insecure. Just having encryption on a
  36. transfer is not enough as you cannot be sure that you are communicating with
  37. the correct end\-point.
  38. .SH DEFAULT
  39. 1
  40. .SH PROTOCOLS
  41. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  42. All TLS backends support this option.
  43. .SH EXAMPLE
  44. .nf
  45. int main(void)
  46. {
  47. CURL *curl = curl_easy_init();
  48. if(curl) {
  49. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  50. /* Set the default value: strict certificate check please */
  51. curl_easy_setopt(curl, CURLOPT_PROXY_SSL_VERIFYPEER, 1L);
  52. curl_easy_perform(curl);
  53. }
  54. }
  55. .fi
  56. .SH AVAILABILITY
  57. Added in curl 7.52.0
  58. .SH RETURN VALUE
  59. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  60. .SH SEE ALSO
  61. .BR CURLOPT_PROXY_SSL_VERIFYHOST (3),
  62. .BR CURLOPT_SSL_VERIFYHOST (3),
  63. .BR CURLOPT_SSL_VERIFYPEER (3)