CURLOPT_UNRESTRICTED_AUTH.3 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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_UNRESTRICTED_AUTH 3 "17 Jun 2014" libcurl libcurl
  26. .SH NAME
  27. CURLOPT_UNRESTRICTED_AUTH \- send credentials to other hosts too
  28. .SH SYNOPSIS
  29. .nf
  30. #include <curl/curl.h>
  31. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_UNRESTRICTED_AUTH,
  32. long goahead);
  33. .SH DESCRIPTION
  34. Set the long \fIgohead\fP parameter to 1L to make libcurl continue to send
  35. authentication (user+password) credentials when following locations, even when
  36. hostname changed. This option is meaningful only when setting
  37. \fICURLOPT_FOLLOWLOCATION(3)\fP.
  38. Further, when this option is not used or set to \fB0L\fP, libcurl will not
  39. send custom set nor internally generated Authentication: headers on requests
  40. done to other hosts than the one used for the initial URL.
  41. By default, libcurl will only send credentials and Authentication headers to
  42. the initial host name as given in the original URL, to avoid leaking username
  43. + password to other sites.
  44. This option should be used with caution: when curl follows redirects it
  45. blindly fetches the next URL as instructed by the server. Setting
  46. \fICURLOPT_UNRESTRICTED_AUTH(3)\fP to 1L will therefore also make curl trust
  47. the server and send possibly sensitive credentials to a host the server points
  48. out.
  49. .SH DEFAULT
  50. 0
  51. .SH PROTOCOLS
  52. HTTP
  53. .SH EXAMPLE
  54. .nf
  55. CURL *curl = curl_easy_init();
  56. if(curl) {
  57. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
  58. curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
  59. curl_easy_setopt(curl, CURLOPT_UNRESTRICTED_AUTH, 1L);
  60. curl_easy_perform(curl);
  61. }
  62. .fi
  63. .SH AVAILABILITY
  64. Along with HTTP
  65. .SH RETURN VALUE
  66. Returns CURLE_OK if HTTP is supported, and CURLE_UNKNOWN_OPTION if not.
  67. .SH "SEE ALSO"
  68. .BR CURLOPT_FOLLOWLOCATION "(3), " CURLOPT_USERPWD "(3), "