我试图让以下bash脚本工作(从
http://curl.haxx.se/mail/archive-2014-10/0006.html#replies复制):
原文链接:https://www.f2er.com/bash/387150.html#!/bin/sh file=path/to/file bucket=your-bucket resource="/${bucket}/${file}" contentType="application/x-compressed-tar" dateValue="`date +'%a,%d %b %Y %H:%M:%S %z'`" stringToSign="GET ${contentType} ${dateValue} ${resource}" s3Key=xxxxxxxxxxxxxxxxxxxx s3Secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx signature=`/bin/echo -n "$stringToSign" | openssl sha1 -hmac ${s3Secret} -binary | base64` curl -H "Host: ${bucket}.s3.amazonaws.com" \ -H "Date: ${dateValue}" \ -H "Content-Type: ${contentType}" \ -H "Authorization: AWS ${s3Key}:${signature}" \ https://${bucket}.s3.amazonaws.com/${file}
无论我做什么,我都会收到SignatureDoesNotMatch错误.
任何关于如何解决这个问题的想法将不胜感激.