CURLOPT_DOH_SSL_VERIFYHOST.3 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  9. .\" *
  10. .\" * This software is licensed as described in the file COPYING, which
  11. .\" * you should have received as part of this distribution. The terms
  12. .\" * are also available at https://curl.se/docs/copyright.html.
  13. .\" *
  14. .\" * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. .\" * copies of the Software, and permit persons to whom the Software is
  16. .\" * furnished to do so, under the terms of the COPYING file.
  17. .\" *
  18. .\" * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. .\" * KIND, either express or implied.
  20. .\" *
  21. .\" * SPDX-License-Identifier: curl
  22. .\" *
  23. .\" **************************************************************************
  24. .\"
  25. .TH CURLOPT_DOH_SSL_VERIFYHOST 3 "11 Feb 2021" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_DOH_SSL_VERIFYHOST \- verify the host name in the DoH SSL certificate
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DOH_SSL_VERIFYHOST,
  32. long verify);
  33. .fi
  34. .SH DESCRIPTION
  35. Pass a long set to 2L as asking curl to \fIverify\fP the DoH (DNS-over-HTTPS)
  36. server's certificate name fields against the host name.
  37. This option is the DoH equivalent of \fICURLOPT_SSL_VERIFYHOST(3)\fP and
  38. only affects requests to the DoH server.
  39. When \fICURLOPT_DOH_SSL_VERIFYHOST(3)\fP is 2, the SSL certificate provided by
  40. the DoH server must indicate that the server name is the same as the server
  41. name to which you meant to connect to, or the connection fails.
  42. Curl considers the DoH server the intended one when the Common Name field or a
  43. Subject Alternate Name field in the certificate matches the host name in the
  44. DoH URL to which you told Curl to connect.
  45. When the \fIverify\fP value is set to 1L it is treated the same as 2L. However
  46. for consistency with the other \fIVERIFYHOST\fP options we suggest use 2 and
  47. not 1.
  48. When the \fIverify\fP value is set to 0L, the connection succeeds regardless of
  49. the names used in the certificate. Use that ability with caution!
  50. See also \fICURLOPT_DOH_SSL_VERIFYPEER(3)\fP to verify the digital signature
  51. of the DoH server certificate. If libcurl is built against NSS and
  52. \fICURLOPT_DOH_SSL_VERIFYPEER(3)\fP is zero,
  53. \fICURLOPT_DOH_SSL_VERIFYHOST(3)\fP is also set to zero and cannot be
  54. overridden.
  55. .SH DEFAULT
  56. 2
  57. .SH PROTOCOLS
  58. DoH
  59. .SH EXAMPLE
  60. .nf
  61. CURL *curl = curl_easy_init();
  62. if(curl) {
  63. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  64. curl_easy_setopt(curl, CURLOPT_DOH_URL, "https://cloudflare-dns.com/dns-query");
  65. /* Disable host name verification of the DoH server */
  66. curl_easy_setopt(curl, CURLOPT_DOH_SSL_VERIFYHOST, 0L);
  67. curl_easy_perform(curl);
  68. }
  69. .fi
  70. .SH AVAILABILITY
  71. Added in 7.76.0
  72. If built TLS enabled.
  73. .SH RETURN VALUE
  74. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  75. .SH "SEE ALSO"
  76. .BR CURLOPT_DOH_SSL_VERIFYPEER "(3), "
  77. .BR CURLOPT_SSL_VERIFYHOST "(3), "
  78. .BR CURLOPT_SSL_VERIFYPEER "(3), "
  79. .BR CURLOPT_PROXY_SSL_VERIFYPEER "(3), "
  80. .BR CURLOPT_PROXY_SSL_VERIFYHOST "(3), "