当我使用SSECustomerKey时,Boto3 put_object()失败

2024-05-13 15:02:09 发布

您现在位置:Python中文网/ 问答频道 /正文

在过去的一天中,我一直在尝试将一些加密文本加载到Ceph对象存储中,但每当我尝试时,都会出现以下错误:

botocore.exceptions.ClientError:调用PutObject操作时发生错误(InvalidRequest):未知

我使用的代码如下:

random_key = os.urandom(32)

s3.put_object(Bucket=BUCKET_NAME,
              Key=KEY,
              Body='the quick brown fox jumps over the lazy dog',
              SSECustomerKey=random_key,
              SSECustomerAlgorithm='AES256'
              )

我要说的是,如果我删除SSECustomerKey=random_key,SSECustomerAlgorithm='AES256' 然后加载文本


Tags: the对象key文本错误randomexceptionsaes256