Problem description
The value of the x-oss-content-sha256 header is invalid.
Causes
Your request uses the V4 signature, but the x-oss-content-sha256 header contains an incorrect value.
Examples
The following request uses the V4 signature with an incorrect x-oss-content-sha256 value:
GET /oss.jpg HTTP/1.1
Host: oss-example.oss-cn-hangzhou.aliyuncs.com
Date: Tue, 20 Dec 2022 08:48:18 GMT
Authorization: OSS4-HMAC-SHA256 Credential=AK**ID/20221220/us-east-1/oss/abc,Signature=18**0a
x-oss-content-sha256: 78a***df
Solutions
Set the x-oss-content-sha256 header to UNSIGNED-PAYLOAD.
References
-
For information about how to use Alibaba Cloud SDKs to initiate a request that uses the V4 signature, see Overview.
-
Calculate the signature:
-
For information about how to calculate the V4 signature, see Calculate V4 signature by using OSS SDK for Python.
-
For information about how to specify the signature logic based on the V1 signature, see Overview.
If the server returns a response that contains the
StringToSignparameter, you must check whether the value of the StringToSign parameter on the server is the same as the string before calculation. -