CURLOPT_PROXY_SSL_VERIFYHOST.3 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .\" generated by cd2nroff 0.1 from CURLOPT_PROXY_SSL_VERIFYHOST.md
  2. .TH CURLOPT_PROXY_SSL_VERIFYHOST 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_PROXY_SSL_VERIFYHOST \- verify the proxy certificate\(aqs name against host
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_PROXY_SSL_VERIFYHOST,
  9. long verify);
  10. .fi
  11. .SH DESCRIPTION
  12. Pass a long set to 2L as asking curl to \fIverify\fP in the HTTPS proxy\(aqs
  13. certificate name fields against the proxy name.
  14. This option determines whether libcurl verifies that the proxy cert contains
  15. the correct name for the name it is known as.
  16. When \fICURLOPT_PROXY_SSL_VERIFYHOST(3)\fP is 2, the proxy certificate must
  17. indicate that the server is the proxy to which you meant to connect to, or the
  18. connection fails.
  19. Curl considers the proxy the intended one when the Common Name field or a
  20. Subject Alternate Name field in the certificate matches the hostname in the
  21. proxy string which you told curl to use.
  22. If \fIverify\fP value is set to 1:
  23. In 7.28.0 and earlier: treated as a debug option of some sorts, not supported
  24. anymore due to frequently leading to programmer mistakes.
  25. From 7.28.1 to 7.65.3: setting it to 1 made \fIcurl_easy_setopt(3)\fP return
  26. an error and leaving the flag untouched.
  27. From 7.66.0: treats 1 and 2 the same.
  28. When the \fIverify\fP value is 0L, the connection succeeds regardless of the
  29. names used in the certificate. Use that ability with caution!
  30. See also \fICURLOPT_PROXY_SSL_VERIFYPEER(3)\fP to verify the digital signature
  31. of the proxy certificate.
  32. .SH DEFAULT
  33. 2
  34. .SH PROTOCOLS
  35. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  36. All TLS backends support this option.
  37. .SH EXAMPLE
  38. .nf
  39. int main(void)
  40. {
  41. CURL *curl = curl_easy_init();
  42. if(curl) {
  43. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  44. /* Set the default value: strict name check please */
  45. curl_easy_setopt(curl, CURLOPT_PROXY_SSL_VERIFYHOST, 2L);
  46. curl_easy_perform(curl);
  47. }
  48. }
  49. .fi
  50. .SH AVAILABILITY
  51. Added in curl 7.52.0
  52. .SH RETURN VALUE
  53. Returns CURLE_OK if TLS is supported, and CURLE_UNKNOWN_OPTION if not.
  54. If 1 is set as argument, \fICURLE_BAD_FUNCTION_ARGUMENT\fP is returned.
  55. .SH SEE ALSO
  56. .BR CURLOPT_CAINFO (3),
  57. .BR CURLOPT_PROXY_CAINFO (3),
  58. .BR CURLOPT_PROXY_SSL_VERIFYPEER (3),
  59. .BR CURLOPT_SSL_VERIFYPEER (3)