Skip to content

Signature mismatch issue with S3ClientΒ #6618

@GowthamShanmugam

Description

@GowthamShanmugam

Checkboxes for prior research

Describe the bug

I am faceing a similar issue, In react I am using S3Client with endpoint: proxy_url.

const client = new S3Client {
      endpoint: 'http://localhost:9000/s3-path',
      forcePathStyle: true,
      credentials: {
        accessKeyId: accessKeyId,
        secretAccessKey: secretAccessKey,
     }
 } 
 
 client.send(new ListBucketsCommand());

The server will receive this request at localhost:9000/s3-path and redirect it to s3-test.devcluster.openshift.com.

The same signature mismatch error is appearing for me. X-Amz-SignedHeaders=host is the issue. To generate the signature, the first call used localhost:9000 as the host. However, the host header that the S3 server receives is s3-test.devcluster.openshift.com. It results in a mismatch in signatures.

How do i resolve this issue?

Regression Issue

  • Select this option if this issue appears to be a regression.

SDK version number

"@aws-sdk/client-s3": "3.667.0",

Which JavaScript Runtime is this issue in?

Browser

Details of the browser/Node.js/ReactNative version

md/browser#Chrome_129.0.0.0

Reproduction Steps

N/A

Observed Behavior

Error Loading : The request signature we calculated does not match the signature you provided. Check your AWS secret access key and signing method. For more information, see REST Authentication and SOAP Authentication for details.

Expected Behavior

It should return list of buckets

Possible Solution

No response

Additional Information/Context

No response

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.closed-for-stalenessp2This is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions