跳转到主内容

CONTAP-345422:当客户端在请求中发送编码的 URI 字符时,签名版本 v4 请求失败,出现签名不匹配错误。

Views:
21
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
CORE
Last Updated:

问题描述

  • 例如,'/'字符是一个保留字符,在前缀中使用它来分隔URL的路径时具有特殊含义。
  • 在这里,它通过将其编码为'%2F'来使用。
  • 将看到以下错误:


[root@linux ~]$curl 'https://s3-server.local/xxxxxxxxxx-xxxxxxx-xxx?prefix=tool/tool/' -X GET -H "Host: s3-server.local"
-H "X-Amz-Content-Sha256: e4xsjdhbsj98fdsfdvcsdvndvfjnsjfvndfvbfaaaa"
-H "X-Amz-Date: 20241126T102448Z"
-H "Authorization: AWS4-HMAC-SHA256 Credential=XAAFEFHU78347328139AAA/20241126/ME2/s3/aws4_request, --cacert cert.pem
<?xml version="1.0" encoding="UTF-8"?><Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message></Error>


  • 其他客户端(例如 S3 浏览器或 aws cli)未遇到此问题。
  • 来自 aws cli 的工作示例:


[root@linux ~]$ s3cmd ls -d s3://xxxxxxxxxx-xxxxxxxx-xx//tool/tool/1
DEBUG: Command: ls
.....
.........
DEBUG: non-proxied HTTPSConnection(s3-server.local, None)
DEBUG: format_uri(): /xxxxxxxxxx-xxxxxxxx-xx/?delimiter=%2F&prefix=%2Ftool%2Ftool%2F1
DEBUG: Sending request method_string='GET', uri='/xxxxxxxxxx-xxxxxxxx-xx/?delimiter=%2F&prefix=%2Ftool%2Ftool%2F1', headers={'x-amz-date': 'Fri, 29 Nov 2024 00:36:34 +0000', 'Authorization': 'AWS xxxxxxxxxx:yyyyyyyyyyyy='}, body=(0 bytes)
....
DEBUG: Response:
.....
.........
'reason': 'OK',
'status': 200}
2024-11-15 02:36 1048576 s3://xxxxxxxxxx-xxxxxxxx-xx//tool/tool/1

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.