close

boto using server side encryption need Signature v4

if not boto.config.get('s3', 'use-sigv4'):
            boto.config.add_section('s3')
            boto.config.set('s3', 'use-sigv4', 'True')


need setting host

HOST = 's3.amazonaws.com'

s3conn = S3Connection(access_key_id, secret_access_key, security_token=security_token, host=HOST)


for_upload_url = s3conn.generate_url(
            3600,
            'PUT',
            self._bucket_name,
            object_key,
            headers = { "x-amz-server-side-encryption": "AES256"

})



test upload

curl --request PUT --upload-file myfile.txt "for_upload_url" --header "x-amz-server-side-encryption: AES256"


http://docs.aws.amazon.com/AmazonS3/latest/dev/ser...

http://docs.aws.amazon.com/AmazonS3/latest/dev/Usi...

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 JohnDX 的頭像
    JohnDX

    我要回家想一想~

    JohnDX 發表在 痞客邦 留言(0) 人氣()