jeudi 25 décembre 2014

Can't connect to S3 buckets with periods in their name, when using Boto on Heroku

We're getting a certificate error when trying to connect to our S3 bucket using Boto. Strangely, this only manifests itself when accessing a bucket with periods in its name WHILE running on Heroku.



from boto.s3.connection import S3Connection
conn = S3Connection({our_s3_key}, {our_s3_secret})
bucket = conn.get_bucket('ourcompany.images')


Raises the following error:



CertificateError: hostname 'ourcompany.images.s3.amazonaws.com' doesn't match either of '*.s3.amazonaws.com', 's3.amazonaws.com'



But the same code works fine when run locally, and would also work on Heroku if the bucket name were 'ourcompany-images' instead of 'ourcompany.images'





Aucun commentaire:

Enregistrer un commentaire