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