aws java 版本,AWS Java SDK手动设置签名版本

I'm trying to access a blob store service which is on top of AWS S3. It supports AWS SDK and it's signature version 2.

I'm using code here to access the this service.

Is it possible to manually set the signature version of the request made by AWS SDK ?

According to this page

AWS currently supports two signature versions: signature version 2 and signature version 4, which are covered in this section. Most services support version 4, and if a service supports version 4, we strongly recommend that you use that version.

I'm unable to find how to set the signature version to 2 or 4 manually.

解决方案

Java SDK

Add the following in your code.

System.setProperty(SDKGlobalConfiguration.ENABLE_S3_SIGV4_SYSTEM_PROPERTY, "true");

Or, on the command line, specify the following.

-Dcom.amazonaws.services.s3.enableV4

It looks like v2 was the default in the AWS SDK previously, but v4 is now the default starting in SDK v1.11.0 (May, 2016).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值