Using Cloudflare CDN + HTTPS with Google Cloud Storage

I’m trying to figure out how to get my Google Cloud Storage bucket to work with Cloudflare. I followed the steps here Static website examples and tips  |  Cloud Storage  |  Google Cloud and did the following:

  1. Added a cname record for where I want to serve my content: cdn.test.stellarguard.mec.storage.googleapis.com
  2. Added a cloud storage bucket for cdn.test.stellarguard.me
  3. Uploaded a file and made it public: https://storage.googleapis.com/cdn.test.stellarguard.me/logo.svg

However, when I go to https://cdn.test.stellarguard.me/logo.svg I see an error that there’s an SSL version mismatch. This is probably because of what is mentioned here:

While you can serve your content through HTTPS using direct URI’s such as , when hosting a static website using a CNAME redirect, Cloud Storage only supports HTTP. To serve your content through a custom domain over SSL, set up a load balancer, use a third-party Content Delivery Network with Cloud Storage, or serve your static website content from Firebase Hosting instead of Cloud Storage.

So I did a little searching and saw someone suggested turning on Flexible SSL, so I added a Page Rule:

*cdn.test.stellarguard.me/* - SSL - Flexible

However, the error still persists. Any ideas?

2 Likes

Cloudflare’s free SSL certificate onyl covers example.com and *.example.com in this instance you have a second level subdomain *.foo.example.com which isn’t covered by this certificate. You can use an alternate hostname (cdn.example.com or test.example.com) or you’d need to purchase a dedicated SSL cert to cover *.test.example.com.

1 Like

Yep, that did the trick - cdn-test.stellarguard.me is working now. Thanks!

1 Like

This topic was automatically closed after 14 days. New replies are no longer allowed.