Search code examples
amazon-web-servicessslamazon-s3amazon-cloudfront

Connection not secured when pointing a subdomain to Cloudfront


I have a domain name hosted on an external server and I'd like to point a subdomain to an S3 bucket using Cloudfront.

I'm already able to point my domain to my S3 bucket (subdomain.s3.amazonaws.com) but it's not HTTPS secured, this is why I created a SSL certificate on AWS, a CloudFront distribution linked to my S3 Bucket and I pointed my subdomain (assets.example.com) to my Cloudfront's domain (xxx.cloudfront.net).

But now, when I try to access my subdomain, I'm getting the following error:

enter image description here

How can I solve this issue? Is there something I misconfigured on my Cloudfront distribution?


Solution

  • You wouldn't have probably added assets.example.com to CloudFront's CNAME/Alternate domain name field.

    CloudFront CNAME

    Also, a certificate a required on CloudFront with the Subject assets.example.com.