Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSE-C encryption doesn't work with a multipart upload #271

Closed
mcproger opened this issue Aug 5, 2022 · 3 comments
Closed

SSE-C encryption doesn't work with a multipart upload #271

mcproger opened this issue Aug 5, 2022 · 3 comments
Assignees
Labels

Comments

@mcproger
Copy link

mcproger commented Aug 5, 2022

  • Async AWS SDK for Python version: 9.3.1
  • Python version: 3.10.5
  • Operating System: Docker image (Debian GNU/Linux 11 (bullseye))

Description

Hello!

SSE-C encryption (Server Side Encryption with Customer provided key) doesn't work well with a multipart upload. It fails with an error botocore.exceptions.ClientError: An error occurred (InvalidRequest) when calling the UploadPart operation: The multipart upload initiate requested encryption. Subsequent part requests must include the appropriate encryption parameters.

The same code snippet works well in the sync version boto3.

What I Did

async with session.client(
    's3',
    aws_access_key_id=access_key_id,
    aws_secret_access_key=secret_access_key,
    region_name=region,
) as session:
    await destination_s3.upload_fileobj(
        raw_stream,
        Bucket=bucket,
        Key=key,
        ExtraArgs={
            'ACL': 'bucket-owner-full-control',
            'SSECustomerAlgorithm': 'AES256',
            'SSECustomerKey': KEY
        },
    )
@terricain terricain self-assigned this Aug 10, 2022
@terricain terricain added the bug label Aug 10, 2022
@terricain
Copy link
Owner

Ah yeah, I have an idea why that might not work. Will look into it on the weekend if I get a chance.

@terricain
Copy link
Owner

Can you try version 10.0.1a0 and see if that fixes it for you?

@terricain
Copy link
Owner

This should be fixed as part of v13.0.0, if not, please re-open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants