Problem description
The format of the Date
or x-oss-date
header field in the request is invalid.
Causes
The value of the Date
header field in the request is not in the GMT format or the value of the x-oss-date
header field is not in the ISO8601
format.
Examples
The V4 signature is used in a request.
Example 1
GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=LTAI****************&x-oss-additional-headers=host&x-oss-signature=8u**** HTTP/1.1 Host: oss-example.oss-cn-hangzhou.aliyuncs.com x-oss-date: Tue, 20 Dec 2022 08:48:18 GMT
The
x-oss-date
header field must be in theISO8601
format. Example:20221220T084818Z
. In this example, the value of the header field isTue, 20 Dec 2022 08:48:18 GMT
, which is in an invalid format.Example 2
GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=LTAI****************&x-oss-additional-headers=host&x-oss-signature=8u**** HTTP/1.1 Host: oss-example.oss-cn-hangzhou.aliyuncs.com Date: 20221220T084818Z
The
Date
header field must be in the GMT format. Example:Tue, 20 Dec 2022 08:48:18 GMT
. In this example, the value of the header field is20221220T084818Z
, which is in an invalid format.
Solutions
Change the value of the
x-oss-date
header field to20221220T084818Z
.GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=LTAI****************&x-oss-additional-headers=host&x-oss-signature=8u**** HTTP/1.1 Host: oss-example.oss-cn-hangzhou.aliyuncs.com x-oss-date: 20221220T084818Z
Change the value of the
Date
header field toTue, 20 Dec 2022 08:48:18 GMT
.GET /oss.jpg?x-oss-signature-verion=OSS4-HMAC-SHA256&x-oss-credential=LTAI****************&x-oss-additional-headers=host&x-oss-signature=8u**** HTTP/1.1 Host: oss-example.oss-cn-hangzhou.aliyuncs.com Date: Tue, 20 Dec 2022 08:48:18 GMT
We recommend that you use Alibaba Cloud SDKs to initiate a request that uses the V4 signature. For more information, see Overview.
References
For information about how to use Object Storage Service (OSS) SDKs to initiate a request that uses 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.