mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-05 20:42:50 +00:00
Support of using AWS IAM Role Access keys
`x-amz-security-token` header is required in HTTP Requests
This commit is contained in:
parent
1f9ca20dfd
commit
8f9bd6e5b9
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
#
|
#
|
||||||
#AWS_ACCESS_KEY_ID="sdfsdfsdfljlbjkljlkjsdfoiwje"
|
#AWS_ACCESS_KEY_ID="sdfsdfsdfljlbjkljlkjsdfoiwje"
|
||||||
@ -29,6 +29,10 @@ dns_aws_add() {
|
|||||||
|
|
||||||
_saveaccountconf AWS_ACCESS_KEY_ID "$AWS_ACCESS_KEY_ID"
|
_saveaccountconf AWS_ACCESS_KEY_ID "$AWS_ACCESS_KEY_ID"
|
||||||
_saveaccountconf AWS_SECRET_ACCESS_KEY "$AWS_SECRET_ACCESS_KEY"
|
_saveaccountconf AWS_SECRET_ACCESS_KEY "$AWS_SECRET_ACCESS_KEY"
|
||||||
|
|
||||||
|
if [ ! -z "$AWS_SESSION_TOKEN" ]; then
|
||||||
|
_saveaccountconf AWS_SESSION_TOKEN "$AWS_SESSION_TOKEN"
|
||||||
|
fi
|
||||||
|
|
||||||
_debug "First detect the root zone"
|
_debug "First detect the root zone"
|
||||||
if ! _get_root "$fulldomain"; then
|
if ! _get_root "$fulldomain"; then
|
||||||
@ -201,6 +205,11 @@ aws_rest() {
|
|||||||
_H3="Authorization: $Authorization"
|
_H3="Authorization: $Authorization"
|
||||||
_debug _H3 "$_H3"
|
_debug _H3 "$_H3"
|
||||||
|
|
||||||
|
if [ ! -z "$AWS_SESSION_TOKEN" ]; then
|
||||||
|
_H4="x-amz-security-token: $AWS_SESSION_TOKEN"
|
||||||
|
_debug _H4 "$_H4"
|
||||||
|
fi
|
||||||
|
|
||||||
url="$AWS_URL/$ep"
|
url="$AWS_URL/$ep"
|
||||||
|
|
||||||
if [ "$mtd" = "GET" ]; then
|
if [ "$mtd" = "GET" ]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user