CURLOPT_DOH_SSL_VERIFYSTATUS.3 1.7 KB

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