【发布时间】:2021-12-05 05:49:58
【问题描述】:
我正在尝试确保我上传到 S3 存储桶的文件在上传时不会被篡改。我正在尝试这个基于一个简单的例子,按照here列出的步骤。
据我了解,通读文档时,需要生成 md5 校验和,然后将其传递到 put 命令的 Content-MD5 标头中。以下是我采取的步骤,但无论如何都失败了。我在这里错过了什么?
openssl md5 -binary test-md5.txt | base64
Y7uGBT9hu26jZFre3slWqw==
aws s3api put-object --bucket cloudtrailmanual --key test-md5.txt --content-md5 Y7uGBT9hu26jZFre3slWqw==
An error occurred (BadDigest) when calling the PutObject operation (reached max retries: 4): The Content-MD5 you specified did not match what we received.
我尝试在不传递二进制标志的情况下生成 md5 校验和,对其进行 base64 编码,然后再次尝试,但同样失败。我在这里错过了什么?
【问题讨论】:
标签: amazon-web-services amazon-s3 checksum