CURLOPT_AWS_SIGV4.3 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. .\" **************************************************************************
  2. .\" * _ _ ____ _
  3. .\" * Project ___| | | | _ \| |
  4. .\" * / __| | | | |_) | |
  5. .\" * | (__| |_| | _ <| |___
  6. .\" * \___|\___/|_| \_\_____|
  7. .\" *
  8. .\" * Copyright (C) 1998 - 2020, 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.haxx.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_AWS_SIGV4 3 "03 Jun 2020" "libcurl 7.75.0" "curl_easy_setopt options"
  24. .SH NAME
  25. CURLOPT_AWS_SIGV4 \- V4 signature
  26. .SH SYNOPSIS
  27. .nf
  28. #include <curl/curl.h>
  29. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_AWS_SIGV4, char *param);
  30. .fi
  31. .SH DESCRIPTION
  32. Provides AWS V4 signature authentication on HTTP(S) header.
  33. .PP
  34. Pass a char * that is the collection of specific arguments are used for
  35. creating outgoing authentication headers.
  36. The format of the param option is:
  37. .IP provider1[:provider2[:region[:service]]]
  38. .IP provider1,\ provider2
  39. The providers arguments are used for generating some authentication parameters
  40. such as "Algorithm", "date", "request type" and "signed headers".
  41. .IP region
  42. The argument is a geographic area of a resources collection.
  43. It is extracted from the host name specified in the URL if omitted.
  44. .IP service
  45. The argument is a function provided by a cloud.
  46. It is extracted from the host name specified in the URL if omitted.
  47. .PP
  48. NOTE: This call set \fICURLOPT_HTTPAUTH(3)\fP to CURLAUTH_AWS_SIGV4.
  49. Calling \fICURLOPT_HTTPAUTH(3)\fP with CURLAUTH_AWS_SIGV4 is the same
  50. as calling this with "aws:amz" in parameter.
  51. .PP
  52. Example with "Test:Try", when curl will do the algorithm, it will generate
  53. "TEST-HMAC-SHA256" for "Algorithm", "x-try-date" and "X-Try-Date" for "date",
  54. "test4_request" for "request type",
  55. "SignedHeaders=content-type;host;x-try-date" for "signed headers"
  56. .PP
  57. If you use just "test", instead of "test:try",
  58. test will be use for every strings generated
  59. .SH DEFAULT
  60. By default, the value of this parameter is NULL.
  61. Calling \fICURLOPT_HTTPAUTH(3)\fP with CURLAUTH_AWS_SIGV4 is the same
  62. as calling this with "aws:amz" in parameter.
  63. .SH PROTOCOLS
  64. HTTP
  65. .SH EXAMPLE
  66. .nf
  67. CURL *curl = curl_easy_init();
  68. struct curl_slist *list = NULL;
  69. if(curl) {
  70. curl_easy_setopt(curl, CURLOPT_URL,
  71. "https://service.region.example.com/uri");
  72. curl_easy_setopt(c, CURLOPT_AWS_SIGV4, "provider1:provider2");
  73. /* service and region also could be set in CURLOPT_AWS_SIGV4 */
  74. /*
  75. curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/uri");
  76. curl_easy_setopt(c, CURLOPT_AWS_SIGV4,
  77. "provider1:provider2:region:service");
  78. */
  79. curl_easy_setopt(c, CURLOPT_USERPWD, "MY_ACCESS_KEY:MY_SECRET_KEY");
  80. curl_easy_perform(curl);
  81. }
  82. .fi
  83. .SH AVAILABILITY
  84. Added in 7.75.0
  85. .SH RETURN VALUE
  86. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  87. .SH NOTES
  88. This option overrides the other auth types you might have set in CURL_HTTPAUTH
  89. which should be highlighted as this makes this auth method special.
  90. This method cannot be combined with other auth types.
  91. .SH "SEE ALSO"
  92. .BR CURLOPT_HEADEROPT "(3), " CURLOPT_HTTPHEADER "(3), "