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"
全站熱搜
留言列表