0
votes

I set up AWS cloudfront to work as a CDN to host some files for my site.

When I use the cloudfront integration – it works in HTTP and HTTPS.

When I use the custom domain – it only works in HTTP.

So, using dummy examples, here's what I mean:

http://www.12345.cloudfront.net/file - Works fine

https://www.12345.cloudfront.net/file - Works fine

http://www.cdn.domainname.com/file - Works fine

https://www.cdn.domainname.com/file - Prompts an insecure site warning message in browsers

I created a custom domain SSL certificate within AWS for cdn.domainname.com--as I thought that would remedy the issue. And, I added that to the cloudfront distribution, but this doesn't seem to have changed anything.

2
It would help if you could share your configuration details. Both for the certificate and for the distribution.Tom Erik Støwer

2 Answers

0
votes

custom SSL certificates for Cloudfront have a different set of requirements than for ELB. You may need to issue a different certificate; also, it used to be that you had to import the certificate in US-East to use it in Cloudfront, not sure if that's still the case.

See details here: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cnames-and-https-requirements.html#https-requirements-aws-region

and: https://aws.amazon.com/premiumsupport/knowledge-center/custom-ssl-certificate-cloudfront/

0
votes

UPDATE: I was able to fix this issue by adding both cdn.domainname.com and www.cdn.domainname.com to the SSL certificate.