1--- 2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3SPDX-License-Identifier: curl 4Title: CURLOPT_DOH_SSL_VERIFYSTATUS 5Section: 3 6Source: libcurl 7See-also: 8 - CURLOPT_DOH_SSL_VERIFYHOST (3) 9 - CURLOPT_DOH_SSL_VERIFYPEER (3) 10 - CURLOPT_SSL_VERIFYSTATUS (3) 11Protocol: 12 - TLS 13TLS-backend: 14 - OpenSSL 15 - GnuTLS 16--- 17 18# NAME 19 20CURLOPT_DOH_SSL_VERIFYSTATUS - verify the DoH SSL certificate's status 21 22# SYNOPSIS 23 24~~~c 25#include <curl/curl.h> 26 27CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DOH_SSL_VERIFYSTATUS, 28 long verify); 29~~~ 30 31# DESCRIPTION 32 33Pass a long as parameter set to 1 to enable or 0 to disable. 34 35This option determines whether libcurl verifies the status of the DoH 36(DNS-over-HTTPS) server cert using the "Certificate Status Request" TLS 37extension (aka. OCSP stapling). 38 39This option is the DoH equivalent of CURLOPT_SSL_VERIFYSTATUS(3) and 40only affects requests to the DoH server. 41 42If this option is enabled and the server does not support the TLS extension, 43the verification fails. 44 45# DEFAULT 46 470 48 49# EXAMPLE 50 51~~~c 52int main(void) 53{ 54 CURL *curl = curl_easy_init(); 55 if(curl) { 56 curl_easy_setopt(curl, CURLOPT_URL, "https://example.com"); 57 58 curl_easy_setopt(curl, CURLOPT_DOH_URL, 59 "https://cloudflare-dns.com/dns-query"); 60 61 /* Ask for OCSP stapling when verifying the DoH server */ 62 curl_easy_setopt(curl, CURLOPT_DOH_SSL_VERIFYSTATUS, 1L); 63 64 curl_easy_perform(curl); 65 } 66} 67~~~ 68 69# AVAILABILITY 70 71Added in 7.76.0. 72 73# RETURN VALUE 74 75Returns CURLE_OK if OCSP stapling is supported by the SSL backend, otherwise 76returns CURLE_NOT_BUILT_IN. 77