使用虚线存储桶名称

时间:2017-09-08 16:05:59

标签: amazon-web-services amazon-s3

假设我有以下存储桶名称long.bucket.name。使用CLI aws s3 presign时,我得到的URL格式为:

https://s3.amazonaws.com/long.bucket.name/path/to/key?AWSAccessKeyId=123&...

但是,在使用GeneratePresignedUrlRequest Java库时,我得到的URL的格式为

https://long.bucket.name.s3.amazonaws.com/path/to/key?AWSAccessKeyId=123&...

此网址存在问题,因为通配符导致SSL认证失败(请参阅http://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html)。如果我尝试使用相同格式的URL https://s3.amazonaws.com/long.bucket.namae...,签名验证将失败

 The request signature we calculated does not match the signature you provided. Check your key and signing method

我唯一能做的就是使用不理想的http。如何正确生成Presign URL?

0 个答案:

没有答案