跳转到主内容

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

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

问题描述

  • 特殊字符需要URI编码(/作为%2F)、应在URL中使用、但仍有一些客户端发送解码值("/")
  • 例如、"/"字符是一个保留字符、在前缀中用于分隔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命令行界面)不面向问题描述。
  • AWS命令行界面中的工作示例:


[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.