CURLOPT_DOH_SSL_VERIFYPEER.3 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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_VERIFYPEER 3 "11 Feb 2021" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_DOH_SSL_VERIFYPEER \- verify the DoH SSL certificate
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_DOH_SSL_VERIFYPEER,
  32. long verify);
  33. .fi
  34. .SH DESCRIPTION
  35. Pass a long as parameter set to 1L to enable or 0L to disable.
  36. This option tells curl to verify the authenticity of the DoH (DNS-over-HTTPS)
  37. server's certificate. A value of 1 means curl verifies; 0 (zero) means it
  38. does not.
  39. This option is the DoH equivalent of \fICURLOPT_SSL_VERIFYPEER(3)\fP and
  40. only affects requests to the DoH server.
  41. When negotiating a TLS or SSL connection, the server sends a certificate
  42. indicating its identity. Curl verifies whether the certificate is authentic,
  43. i.e. that you can trust that the server is who the certificate says it is.
  44. This trust is based on a chain of digital signatures, rooted in certification
  45. authority (CA) certificates you supply. curl uses a default bundle of CA
  46. certificates (the path for that is determined at build time) and you can
  47. specify alternate certificates with the \fICURLOPT_CAINFO(3)\fP option
  48. or the \fICURLOPT_CAPATH(3)\fP option.
  49. When \fICURLOPT_DOH_SSL_VERIFYPEER(3)\fP is enabled, and the verification
  50. fails to prove that the certificate is authentic, the connection fails. When
  51. the option is zero, the peer certificate verification succeeds regardless.
  52. Authenticating the certificate is not enough to be sure about the server. You
  53. typically also want to ensure that the server is the server you mean to be
  54. talking to. Use \fICURLOPT_DOH_SSL_VERIFYHOST(3)\fP for that. The check
  55. that the host name in the certificate is valid for the host name you are
  56. connecting to is done independently of the
  57. \fICURLOPT_DOH_SSL_VERIFYPEER(3)\fP option.
  58. WARNING: disabling verification of the certificate allows bad guys to
  59. man-in-the-middle the communication without you knowing it. Disabling
  60. verification makes the communication insecure. Just having encryption on a
  61. transfer is not enough as you cannot be sure that you are communicating with
  62. the correct end-point.
  63. .SH DEFAULT
  64. 1
  65. .SH PROTOCOLS
  66. DoH
  67. .SH EXAMPLE
  68. .nf
  69. CURL *curl = curl_easy_init();
  70. if(curl) {
  71. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  72. curl_easy_setopt(curl, CURLOPT_DOH_URL, "https://cloudflare-dns.com/dns-query");
  73. /* Disable certificate verification of the DoH server */
  74. curl_easy_setopt(curl, CURLOPT_DOH_SSL_VERIFYPEER, 0L);
  75. curl_easy_perform(curl);
  76. }
  77. .fi
  78. .SH AVAILABILITY
  79. Added in 7.76.0
  80. If built TLS enabled.
  81. .SH RETURN VALUE
  82. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  83. .SH "SEE ALSO"
  84. .BR CURLOPT_DOH_SSL_VERIFYHOST "(3), "
  85. .BR CURLOPT_SSL_VERIFYHOST "(3), "
  86. .BR CURLOPT_SSL_VERIFYPEER "(3), "
  87. .BR CURLOPT_PROXY_SSL_VERIFYPEER "(3), "
  88. .BR CURLOPT_PROXY_SSL_VERIFYHOST "(3), "
  89. .BR CURLOPT_CAINFO "(3), "
  90. .BR CURLOPT_CAPATH "(3), "