jeudi 26 mars 2015

AWS authentication requires a valid Date or x-amz-date header curl

I am trying for simple image upload using cURL by passing the required headers that is requested by AWS but I'm getting the below error...



<Code>AccessDenied</Code><Message>AWS authentication requires a valid Date or x-amz-date header</Message>


Below is the authorization header I'm passing in..



curl -X PUT -T "/some/file.jpg" \
-H "Host: bucket.s3.amazonaws.com" \
-H "Date: date" \
-H "Content-Type: image/jpg" \
-H "Authorization: AWS XXXXXXX:XXXXXXXXXX" \
http://ift.tt/1vUvm8a


and below is how the signature is made,



signature=`echo -en ${stringToSign} | openssl sha1 -hmac ${s3Secret} -binary | base64`


I've tried passing the date in stringToSign and in the headers, but no luck.. Please help ..





1 commentaire:

  1. check this out http://stackoverflow.com/questions/32058431/aws-java-sdk-aws-authentication-requires-a-valid-date-or-x-amz-date-header . It seems to be an issue with joda time version vs. java version.

    RépondreSupprimer