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?

Community
  • 1
  • 1
Will03
  • 145
  • 1
  • 9
  • 2
    [Here's the actual problem and solution.](http://stackoverflow.com/questions/27652318/cant-connect-to-s3-buckets-with-periods-in-their-name-when-using-boto-on-herok) – tedder42 Jan 19 '15 at 04:23

2 Answers2

1

This happens to me with python 2.7.9 and 2.7.10. I found 2 workarounds.

changeing python version to 2.7.8

or

add in ~/.boto file (create if none) the following

[s3]

calling_format = boto.s3.connection.OrdinaryCallingFormat

S3Connection.DefaultHost = ‘s3-ap-northeast-1.amazonaws.com’

Artur Aleksanyan
  • 480
  • 5
  • 10
0

I managed to get my listing using the AWS-CLI solution posted by Lyke here: Quick way to list all files in Amazon S3 bucket?

I had previously avoided CLI because I thought it would only return 1000 objects. However, it succeeded in listing all 2000+ items in my bucket.

Community
  • 1
  • 1
Will03
  • 145
  • 1
  • 9