CURLOPT_SSL_VERIFYSTATUS.3 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. .\" generated by cd2nroff 0.1 from CURLOPT_SSL_VERIFYSTATUS.md
  2. .TH CURLOPT_SSL_VERIFYSTATUS 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_SSL_VERIFYSTATUS \- verify the certificate\(aqs status
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSL_VERIFYSTATUS, long verify);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a long as parameter set to 1 to enable or 0 to disable.
  12. This option determines whether libcurl verifies the status of the server cert
  13. using the "Certificate Status Request" TLS extension (aka. OCSP stapling).
  14. Note that if this option is enabled but the server does not support the TLS
  15. extension, the verification fails.
  16. .SH DEFAULT
  17. 0
  18. .SH PROTOCOLS
  19. This functionality affects all TLS based protocols: HTTPS, FTPS, IMAPS, POP3S, SMTPS etc.
  20. This option works only with the following TLS backends:
  21. GnuTLS and OpenSSL
  22. .SH EXAMPLE
  23. .nf
  24. int main(void)
  25. {
  26. CURL *curl = curl_easy_init();
  27. if(curl) {
  28. CURLcode res;
  29. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  30. /* ask for OCSP stapling! */
  31. curl_easy_setopt(curl, CURLOPT_SSL_VERIFYSTATUS, 1L);
  32. res = curl_easy_perform(curl);
  33. curl_easy_cleanup(curl);
  34. }
  35. }
  36. .fi
  37. .SH AVAILABILITY
  38. Added in curl 7.41.0
  39. .SH RETURN VALUE
  40. Returns CURLE_OK if OCSP stapling is supported by the SSL backend, otherwise
  41. returns CURLE_NOT_BUILT_IN.
  42. .SH SEE ALSO
  43. .BR CURLOPT_CAINFO (3),
  44. .BR CURLOPT_SSL_VERIFYHOST (3),
  45. .BR CURLOPT_SSL_VERIFYPEER (3)