0002-00000066

更新时间:
复制 MD 格式

Problem description

The x-oss-signature-version parameter in the request URL contains an invalid value.

Causes

OSS rejected the request because the value of x-oss-signature-version is not a recognized signature version identifier. The valid values are:

Signature versionValid value for x-oss-signature-version
V1Omit the parameter entirely
V2OSS2

Examples

The following request uses ABC as the value of x-oss-signature-version, which is invalid:

GET /test.txt?x-oss-signature-version=ABC&x-oss-expires=1141889120&x-oss-signature=abc***&x-oss-access-key-id=asfd*** HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com

Solutions

To avoid signature errors altogether, use an Alibaba Cloud SDK. SDKs generate signatures automatically, so you don't need to construct them manually. For details, see Overview.

Fix the request based on which signature version you are using.

Use V1 signature

V1 signed URLs do not include the x-oss-signature-version parameter. Remove it from the URL and use the V1 parameters OSSAccessKeyId, Expires, and Signature.

GET /test.txt?OSSAccessKeyId=nz2pc56s936****&Expires=1141889120&Signature=vjbyPxybdZaNmGa%2ByT272YEAiv**** HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com

Use V2 signature

V2 signed URLs require x-oss-signature-version=OSS2. Set the parameter to exactly OSS2.

GET /test.txt?x-oss-signature-version=OSS2&x-oss-expires=1141889120&x-oss-signature=abc***&x-oss-access-key-id=asfd*** HTTP/1.0
Date: Tue, 20 Dec 2022 08:48:18 GMT
Host: oss-example.oss-cn-hangzhou.aliyuncs.com

For more information on constructing signed URLs, see Add signatures to URLs.