Closed gdavison closed 1 month ago
We call this out in the FAQ - proxies are known to cause issues with signature mismatch as they either add or remove headers.
This isn't behavior we can change by default. The user's only present recourse here is to control the proxy behavior to not modify the request.
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.
Acknowledgements
go get -u github.com/aws/aws-sdk-go-v2/...
)Describe the bug
When used from behind a caching proxy, if the proxy is not configured to pass requests with a
Range
header unchanged, the AWS API returns signature errors. This appears to be because theRange
header is included in the signed headers.Expected Behavior
The expected behaviour is that the requests would succeed, either with parallel requests or with a fallback to requesting the full object.
Current Behavior
The requests fails with a
SignatureDoesNotMatch
error.The request contains the header values:
Authorization: AWS4-HMAC-SHA256 Credential=ASIA************VBYM/20231019/eu-west-1/s3/aws4_request, SignedHeaders=accept-encoding;amz-sdk-invocation-id;amz-sdk-request;host;range;x-amz-content-sha256;x-amz-date;x-amz-security-token, Signature=*****
Range: bytes=0-5242879
In the error response, the
<CanonicalRequest>
, however shows an emptyrange:
, suggesting that the user's proxy remove theRange
header.Reproduction Steps
Use the S3 Download manager from behind a proxy, e.g. nginx, which strips the
Range
header from a request.Possible Solution
Possible solutions are:
Range
header in the request signatureGetObject
request if theRange
d request fails with a signature errorAdditional Information/Context
These are the errors reported to us:
AWS Go SDK V2 Module Versions Used
github.com/aws/aws-sdk-go-v2 v1.30.3 github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.17.8 github.com/aws/aws-sdk-go-v2/service/s3 v1.58.2
Compiler and Version used
go version go1.22.5 darwin/arm64
Operating System and version
macOS 13.6.7 (22G720)