Skip to content

Invalid https certificate if bucket name contains "." like bucket.example #5490

@pidge-raman

Description

@pidge-raman

Checkboxes for prior research

Describe the bug

In V2 the url format is

https://s3.{region}.amazonaws.com/{bucket-name}/{file-path}

but now in v3 the format is updated to

https://{bucket-name}.s3.{region}.amazonaws.com/{file-path}

now because bucket-name is as sub-domain the https certificate becomes invalid if bucket-name has.
for e.g
https://example.bucket.s3.ap-south-1.amazonaws.com/ but their certificate is valid for domain **.s3.ap-south-1.amazonaws.com/ only allow one level sub-domain before s3

SDK version number

@aws-sdk/lib-storage@3.451.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v18.16.0

Reproduction Steps

  • Create bucket name which contains "." in it like example.bucket
  • Upload a file using @aws-sdk/lib-storage
  • Open the returned Location it give TLS "NET::ERR_CERT_COMMON_NAME_INVALID"

Observed Behavior

Returned Location it give TLS "NET::ERR_CERT_COMMON_NAME_INVALID" when try to open the image

Expected Behavior

Return location endpoint should work

Possible Solution

Either switch back to older url format or make the *.s3 certificate support multiple sub-domain

Additional Information/Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue is a bug.needs-triageThis issue or PR still needs to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions