I want to download(GET) file from Amazon AWS S3, and I want to write the commands into a shell script.But I always get the error message:AWS authentication requires a valid Date or x-amz-date header.I'm sure that my key are all right.Here is my s3.sh from https://stackoverflow.com/questions/27658147/download-private-file-from-s3-using-bash:#!/bin/shs3key=xxxxxxxxxxxxxxxxxxxxs3skey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxfile=/aaa.pdfbucket=testdate=$(date +%a, %d %b %Y %T %z)echo $datecontent_type='application/x-compressed-tar'string=GET\n\n$content_type\n$date\n/$bucket$filesignature=$(echo -en ${string} | openssl sha1 -hmac ${s3skey} -binary | base64)curl -H Host: $bucket.s3.amazonaws.com \    -H Date: $date \    -H x-amz-date: $date \    -H Content-Type: $content_type \    -H Authorization: AWS ${s3key}:$signature \ https://$bucket.s3-ap-northeast-1.amazonaws.com$fileand it always shows the error message:<Code>AccessDenied</Code><Message>AWS authentication requires a valid Date or x-amz-date header</Message>anyone has ideas?thx
authentication requires a valid Date when I connect to AWS S3
linux;shell script;aws
Your script uses the following value for datedate=$(date +%a, %d %b %Y %T %z)The script you reference uses a different date format.  As that other format works ok, change your script to follow that.dateValue=`date +'%a, %d %b %Y %H:%M:%S %z'` 