DO Spaces CDN with Cloudflare custom domain

Trying to get a custom domain for my Digital Ocean Spaces Bucket, really can’t find any solution…

What I’m doing:

I’ve setup a CNAME at Cloudflare (Name: “files”, Target:, Proxy: Enabled, SSL/TLS: Full (strict))

I’ve created a Origin Certificate (RSA (2048), Hostnames:, Certificate Validity: 15yrs)

Key Format PEM Copy/Paste Origin Certificate and Private Key to:

DO - Spaces Object Storage - bucket-name/ - Settings - CDN Enabled - Edit CDN - +Add a new subdomain certificate - “Bring your own certificate”:

Certificate name* mysslcertificatename


Private key* -----BEGIN PRIVATE KEY----- prIVAtEkeYfROMcLOUdFLarE -----END PRIVATE KEY-----

Certificate chain <empty>

Subdomain* files

I then click the button: “Generate Certificate and Use Subdomain”.

This is what I see in DO - Spaces - Bucket - Settings:

image alt text
image caption

I’ve previously had this setup working, but I suddenly experienced that the my custom domain CNAME was not working properly, so I disabled the CDN for the bucket and tried to enable it again. I’ve tried recreating what I did originally, but I’m not able to make it work.

It looks like there’s an issue with the SSL certificate., but I’m not really sure at this point.

I’d really appreciate some help here

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Site Moderator
Site Moderator badge
April 16, 2024

Heya, @magnusstrand

You can double check the certificate files and make sure the SSL has not expired as well.

Also, please note that you cannot secure a CDN’s subdomain with a CloudFlare Origin CA certificate or with a custom wildcard SSL certificate that you are already using elsewhere in your account. In these cases, add a new custom certificate during the custom subdomain set up for your CDN.


Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel