0

When I access image from S3 bucket using HTTPS I get error as, net::ERR_INSECURE_RESPONSE for s3 bucket.

I want to load image file using HTTPS only.
Below is the link of image file which I can access using HTTP but can not using HTTPS. https://bucket.leadient.s3.amazonaws.com/9/branding_image/585ce85fa788a.jpg

This is my CORS

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
    <CORSRule>
        <AllowedOrigin>*</AllowedOrigin>
        <AllowedMethod>GET</AllowedMethod>
        <AllowedMethod>POST</AllowedMethod>
        <AllowedMethod>PUT</AllowedMethod>
        <AllowedMethod>DELETE</AllowedMethod>
        <MaxAgeSeconds>3000</MaxAgeSeconds>
        <ExposeHeader>ETag</ExposeHeader>
        <AllowedHeader>*</AllowedHeader>
    </CORSRule>
</CORSConfiguration>

I granteed all permissions for my user and only list for Everyone.

Why when I upload a picture, that picture is not shown on my website (net::ERR_INSECURE_RESPONSE)?
I have not set any policy for S3 bucket.

AndyPHP
  • 361
  • 2
  • 5

1 Answers1

0

Finally, I found the answer myself.

The CORS settings were perfect and there is no need to set any policy for bucket.

The URL is wrong.
The proper URL is as below,
https://s3-us-west-2.amazonaws.com/bucket.leadient/9/branding_image/585ce85fa788a.jpg

First I searched for the region with which bucket is created and respective endpoint for that region.
My buckets region was US west (Oregon) and hence the endpoint became
s3-us-west-2.amazonaws.com.
And I placed my bucket.leadient after the endpoint and error resolved.
Link helped me
Amazon S3 ERR_INSECURE_RESPONSE on Laravel

Community
  • 1
  • 1
AndyPHP
  • 361
  • 2
  • 5
  • 3
    The `example-bucket.s3.amazonaws.com` URL isn't exactly "wrong" -- your content is there, too -- but the dot in your bucket name causes your browser to conclude that the SSL cert isn't trustworthy, because the `*` in a wildcard cert is not permitted to match a dot, and the certificate is for `*.s3.amazonaws.com`. For bucket names without dots *or* if you aren't using SSL, *both* styles are equivalent. For IPv6 support, use `https://s3.dualstack.us-west-2.amazonaws.com/bucket/...`. – Michael - sqlbot Dec 28 '16 at 11:00
  • 1
    Thanks Michael for your help. It is very helpful for me :) – AndyPHP Jan 31 '17 at 07:55
  • 1
    @Michael-sqlbot Thanks for the information. That really helped me and saved a lot of time. – Vibhav Chaddha Apr 10 '19 at 09:43