2

I need a complete listing of all the objects in an s3 bucket with a particular prefix. I have tried using previously mentioned solutions using boto and knox-copy, however, my bucket is named after a domain (ex: cdn.mycompany.com) and I get the following error back from boto

ssl.CertificateError: hostname 'cdn.mycompany.com.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com'

I get a similar error back from knox-copy. Both work just fine if I use a bucket name without periods. Is there a way around this?

4

2 回答 2

1

这发生在 python 2.7.9 和 2.7.10 上。我找到了 2 个解决方法。

将 python 版本更改为 2.7.8

或者

添加 ~/.boto 文件(如果没有则创建)以下

[s3]

call_format = boto.s3.connection.OrdinaryCallingFormat

S3Connection.DefaultHost = 's3-ap-northeast-1.amazonaws.com'</p>

于 2015-09-02T12:57:20.000 回答
0

我设法使用 Lyke 在此处发布的 AWS-CLI 解决方案获取我的列表: 列出 Amazon S3 存储桶中所有文件的快速方法?

我以前避免使用 CLI,因为我认为它只会返回 1000 个对象。但是,它成功地列出了我存储桶中的所有 2000 多个项目。

于 2015-01-19T04:04:29.013 回答