-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The request signature we calculated does not match the signature you provided. Check your key and signing method. #1252
Comments
Hello @nextdimension, thank you for reaching out to us. It looks like the Acl header is not being signed on the service's end. I am going to reach out to the service team and see why that is. |
Oh, thank godness, theres an answer! I was going out of my mind :D Thanks. |
@nextdimension - It looks like you have to set the header explicitly in the request. package main
import (
"fmt"
"net/http"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
)
func main() {
svc := s3.New(session.New(&aws.Config{Region: aws.String("eu-west-2")}))
req, _ := svc.PutObjectRequest(&s3.PutObjectInput{
ACL: aws.String("public-read"),
Bucket: aws.String("BUCKET"),
Key: aws.String("MY KEY"),
})
str, headers, _ := req.PresignRequest(15 * time.Minute)
httpreq, _ := http.NewRequest("PUT", str, nil)
for k, values := range headers {
for _, value := range values {
httpreq.Header.Add(k, value)
}
}
fmt.Println(http.DefaultClient.Do(httpreq))
} If you have any additional issues, please let us know! |
I am going to go ahead and close this issue. If you are still having issues, please reopen this. |
@xibz |
Adding the headers worked for me. Thanks! |
Figured it out... although I didn't need the 'public-read' ACL argument. Needed to add non-zero |
Updates smithy Gradle dependency to v0.5.3.
Version of AWS SDK for Go?
Latest
Version of Go (
go version
)?go version go1.8 linux/amd64
What issue did you see?
When creating a PutObjectRequest like below it works fine I can PUT the file no problem. When I add
ACL: aws.String("public-read"),
I get the error in the title, here is a sample of the url the GO sdk is generating.https://<MY-BUCKET>.s3.eu-west-2.amazonaws.com/<MY-KEY>?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=<AWS_ACCESS_KEY>/20170505/eu-west-2/s3/aws4_request&X-Amz-Date=20170505T793528Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host;x-amz-acl&X-Amz-Signature=2584062aaa76545665bfed7204fcf0dfe233a45016f698e7e8a11c34a5a7921e
I have tried with the root aws user and a normal user.
I have tried with bucket policy and without, and with bucket policy and IAM policy of FULL S3 access and without. Basically all combinations. Any time I add the ACL field the signature error appears.
I do not think that the url is being generated properly.
The text was updated successfully, but these errors were encountered: