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

前端 未结 1 1680
自闭症患者
自闭症患者 2020-12-29 06:50

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

相关标签:
1条回答
  • 2020-12-29 07:28

    According to the relevant github issue, add this to the configuration:

    [s3]
    calling_format = boto.s3.connection.OrdinaryCallingFormat
    

    Or, specify the calling_format while instantiating an S3Connection:

    from boto.s3.connection import OrdinaryCallingFormat
    
    conn = S3Connection(access_key, secret_key, calling_format=OrdinaryCallingFormat())
    

    The code worked for you locally and didn't work on heroku, most likely, because of the different python versions used. I suspect you are using 2.7.9 runtime on heroku, which has enabled certificate checks for stdlib http clients.

    0 讨论(0)
提交回复
热议问题