> Just in case anyone else runs into this, I had this same problem and
> the problem came down to having capital letters in my bucket name. I
> created my bucked on the AWS Management console, something like:
> MyBucket. But, somewhere along the line the process was turning the
> MyBucket into mybucket, and I only discovered this by checking the
> reply XML from the server reporting the invalid signature and I could
> see a line with mybucket in lowercase. Figuring that can't be good I
> made a new bucket "mybucket" no caps, and moved all the files into
> it. Once I did that the same code worked perfectly.
I think this is because ASIS3Request refers to the bucket using the virtual host style, eg: http://mybucket.s3.amazonaws.com.
IIRC you can perform requests with the REST API in a different way that would allow you to use a mix of upper and lowercase characters, but I think the value of being able to use a subdomain to refer to your bucket probably outweighs the advantage of this, especially if you are making your resources public.
Incidentally, there are other restrictions on the names you can use with the dns style (eg: no underscores), see:
http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?BucketRestrictions.html
I should probably add a note on this to the documentation.
Best
Ben