CURLOPT_DOH_SSL_VERIFYHOST.3 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2021, 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. .\" **************************************************************************
  22. .\"
  23. .TH CURLOPT_DOH_SSL_VERIFYHOST 3 "11 Feb 2021" "libcurl 7.76.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_DOH_SSL_VERIFYHOST \- verify the host name in the DoH SSL certificate
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DOH_SSL_VERIFYHOST,
  30. long verify);
  31. .fi
  32. .SH DESCRIPTION
  33. Pass a long set to 2L as asking curl to \fIverify\fP the DoH (DNS-over-HTTPS)
  34. server's certificate name fields against the host name.
  35. This option is the DoH equivalent of \fICURLOPT_SSL_VERIFYHOST(3)\fP and
  36. only affects requests to the DoH server.
  37. When \fICURLOPT_DOH_SSL_VERIFYHOST(3)\fP is 2, the SSL certificate provided by
  38. the DoH server must indicate that the server name is the same as the server
  39. name to which you meant to connect to, or the connection fails.
  40. Curl considers the DoH server the intended one when the Common Name field or a
  41. Subject Alternate Name field in the certificate matches the host name in the
  42. DoH URL to which you told Curl to connect.
  43. When the \fIverify\fP value is set to 1L it is treated the same as 2L. However
  44. for consistency with the other VERIFYHOST options we suggest use 2 and not 1.
  45. When the \fIverify\fP value is set to 0L, the connection succeeds regardless of
  46. the names used in the certificate. Use that ability with caution!
  47. See also \fICURLOPT_DOH_SSL_VERIFYPEER(3)\fP to verify the digital signature
  48. of the DoH server certificate. If libcurl is built against NSS and
  49. \fICURLOPT_DOH_SSL_VERIFYPEER(3)\fP is zero,
  50. \fICURLOPT_DOH_SSL_VERIFYHOST(3)\fP is also set to zero and cannot be
  51. overridden.
  52. .SH DEFAULT
  53. 2
  54. .SH PROTOCOLS
  55. DoH
  56. .SH EXAMPLE
  57. .nf
  58. CURL *curl = curl_easy_init();
  59. if(curl) {
  60. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  61. curl_easy_setopt(curl, CURLOPT_DOH_URL, "https://cloudflare-dns.com/dns-query");
  62. /* Disable host name verification of the DoH server */
  63. curl_easy_setopt(curl, CURLOPT_DOH_SSL_VERIFYHOST, 0L);
  64. curl_easy_perform(curl);
  65. }
  66. .fi
  67. .SH AVAILABILITY
  68. Added in 7.76.0
  69. If built TLS enabled.
  70. .SH RETURN VALUE
  71. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  72. .SH "SEE ALSO"
  73. .BR CURLOPT_DOH_SSL_VERIFYPEER "(3), "
  74. .BR CURLOPT_SSL_VERIFYHOST "(3), "
  75. .BR CURLOPT_SSL_VERIFYPEER "(3), "
  76. .BR CURLOPT_PROXY_SSL_VERIFYPEER "(3), "
  77. .BR CURLOPT_PROXY_SSL_VERIFYHOST "(3), "