Skip to content

[JENKINS-76422] Fix useServerSideEncryption using SSE-C header instead of SSE-S3#366

Open
namekun wants to merge 1 commit intojenkinsci:masterfrom
namekun:fix/use-correct-sse-s3-encryption
Open

[JENKINS-76422] Fix useServerSideEncryption using SSE-C header instead of SSE-S3#366
namekun wants to merge 1 commit intojenkinsci:masterfrom
namekun:fix/use-correct-sse-s3-encryption

Conversation

@namekun
Copy link
Copy Markdown

@namekun namekun commented Mar 19, 2026

Hi, thanks for maintaining this plugin!

I ran into an issue after upgrading to v505+ where enabling "Server side encryption" in job config causes the following error:

S3Exception: Requests specifying Server Side Encryption with Customer provided keys must provide an appropriate secret key. (Service: S3, Status Code: 400)

It looks like S3BaseUploadCallable.buildMetadata() calls sseCustomerAlgorithm("AES256"), which sets the SSE-C header (x-amz-server-side-encryption-customer-algorithm). SSE-C requires a customer-provided key, but the plugin doesn't send one.

I believe this was an unintended change during the SDK v1 to v2 migration. The original intent was SSE-S3 (AWS-managed keys), not SSE-C (customer-provided keys).

This PR replaces:

- metadata.sseCustomerAlgorithm("AES256");
+ metadata.serverSideEncryption(ServerSideEncryption.AES256);

This sets the correct x-amz-server-side-encryption: AES256 header for SSE-S3.

Let me know if anything needs to be changed. Thanks!

Since the AWS SDK v2 migration (v505), the useServerSideEncryption option
incorrectly calls sseCustomerAlgorithm("AES256") which sets the SSE-C
header (x-amz-server-side-encryption-customer-algorithm). This causes
S3Exception because SSE-C requires a customer-provided encryption key
that the plugin never sends.

Replace with serverSideEncryption(ServerSideEncryption.AES256) which
correctly sets the SSE-S3 header (x-amz-server-side-encryption).
@namekun namekun closed this Mar 19, 2026
@namekun namekun changed the title Fix useServerSideEncryption using SSE-C header instead of SSE-S3 [JENKINS-76422] Fix useServerSideEncryption using SSE-C header instead of SSE-S3 Mar 19, 2026
@namekun namekun reopened this Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant