CURLOPT_DOH_URL.3 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 2018 - 2022, 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_URL 3 "18 Jun 2018" "libcurl 7.62.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_DOH_URL \- provide the DNS-over-HTTPS URL
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DOH_URL, char *URL);
  30. .fi
  31. .SH DESCRIPTION
  32. Pass in a pointer to a \fIURL\fP for the DoH server to use for name
  33. resolving. The parameter should be a char * to a null-terminated string which
  34. must be URL-encoded in the following format: "https://host:port/path". It MUST
  35. specify an HTTPS URL.
  36. libcurl does not validate the syntax or use this variable until the transfer is
  37. issued. Even if you set a crazy value here, \fIcurl_easy_setopt(3)\fP will
  38. still return \fICURLE_OK\fP.
  39. curl sends POST requests to the given DNS-over-HTTPS URL.
  40. To find the DoH server itself, which might be specified using a name, libcurl
  41. will use the default name lookup function. You can bootstrap that by providing
  42. the address for the DoH server with \fICURLOPT_RESOLVE(3)\fP.
  43. Disable DoH use again by setting this option to NULL.
  44. .SH "INHERIT OPTIONS"
  45. DoH lookups use SSL and some SSL settings from your transfer are inherited,
  46. like \fICURLOPT_SSL_CTX_FUNCTION(3)\fP.
  47. The hostname and peer certificate verification settings are not inherited but
  48. can be controlled separately via \fICURLOPT_DOH_SSL_VERIFYHOST(3)\fP and
  49. \fICURLOPT_DOH_SSL_VERIFYPEER(3)\fP.
  50. A set \fICURLOPT_OPENSOCKETFUNCTION(3)\fP callback is not inherited.
  51. .SH "KNOWN BUGS"
  52. Even when DoH is set to be used with this option, there are still some name
  53. resolves that are performed without it, using the default name resolver
  54. mechanism. This includes name resolves done for \fICURLOPT_INTERFACE(3)\fP,
  55. \fICURLOPT_FTPPORT(3)\fP, a proxy type set to \fBCURLPROXY_SOCKS4\fP or
  56. \fBCURLPROXY_SOCKS5\fP and probably some more.
  57. .SH DEFAULT
  58. NULL - there is no default DoH URL. If this option is not set, libcurl will use
  59. the default name resolver.
  60. .SH PROTOCOLS
  61. All
  62. .SH EXAMPLE
  63. .nf
  64. CURL *curl = curl_easy_init();
  65. if(curl) {
  66. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  67. curl_easy_setopt(curl, CURLOPT_DOH_URL, "https://dns.example.com");
  68. curl_easy_perform(curl);
  69. }
  70. .fi
  71. .SH AVAILABILITY
  72. Added in 7.62.0
  73. .SH RETURN VALUE
  74. Returns CURLE_OK on success or CURLE_OUT_OF_MEMORY if there was insufficient
  75. heap space.
  76. Note that \fIcurl_easy_setopt(3)\fP will not immediately parse the given
  77. string so when given a bad DoH URL, libcurl might not detect the problem until
  78. it later tries to resolve a name with it.
  79. .SH "SEE ALSO"
  80. .BR CURLOPT_VERBOSE "(3), " CURLOPT_RESOLVE "(3), "