不支持您所提供的授权机制。请使用AWS4-HMAC-SHA256 [英] The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256

查看:3668
本文介绍了不支持您所提供的授权机制。请使用AWS4-HMAC-SHA256的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到一个错误 AWS :: S3 ::错误:: InvalidRequest的授权机制您提供不支持。请使用AWS4-HMAC-SHA256。当我尝试上传文件到S3存储在新的法兰克福地区。所有与美国标准区域正常工作。

I get an error AWS::S3::Errors::InvalidRequest The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. when I try upload file to S3 bucket in new Frankfurt region. All works properly with US Standard region.

脚本:

backup_file = '/media/db-backup_for_dev/2014-10-23_02-00-07/slave_dump.sql.gz'
s3 = AWS::S3.new(
    access_key_id:     AMAZONS3['access_key_id'],
    secret_access_key: AMAZONS3['secret_access_key']
)

s3_bucket = s3.buckets['test-frankfurt']

# Folder and file name
s3_name = "database-backups-last20days/#{File.basename(File.dirname(backup_file))}_#{File.basename(backup_file)}"

file_obj = s3_bucket.objects[s3_name]
file_obj.write(file: backup_file)

AWS-SDK(1.56.0)

aws-sdk (1.56.0)

如何解决?

感谢你。

推荐答案

AWS4-HMAC-SHA256,也被称为V4,是在S3中两种认证方案中的一个。

AWS4-HMAC-SHA256, also known as "V4," is one of two authentication schemes in S3.

美国标准,而且很多 - 但不是全部 - 其他地区,也支持其他的,旧的计划,V2

US-Standard, and many -- but not all -- other regions, also support the other, older scheme, V2.

据<一href="http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html">http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html一月后,部署了......新S3的地区,2014年将只支持V4。

According to http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html ... new S3 regions deployed after January, 2014 will only support V4.

由于法兰克福引入晚于2014年,它显然不支持V2,这是你使用的这个错误提示。

Since Frankfurt was introduced late in 2014, it apparently does not support V2, which is what this error suggests you are using.

<一个href="http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html">http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html说明如何启用V4在各种SDK,假设你使用的是具有这种能力的SDK。

http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html explains how to enable V4 in the various SDKs, assuming you are using an SDK that has that capability.

我推测,一些旧版本的SDK可能不支持这个选项,因此,如果上面没有帮助,你可能需要一个较新的版本中,您正在使用的SDK。

I would speculate that some older versions of the SDKs might not support this option, so if the above doesn't help, you may need a newer release of the SDK you are using.

这篇关于不支持您所提供的授权机制。请使用AWS4-HMAC-SHA256的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆