Using Cloudflare certificates

If I wanted to try and use a certificate provided by cloudfare itself, like in the screenshot below:

(obviously I’d need a new certificate because this one is expired)

How can I do it? Is it correct to just do:

tls [cert.pem_location] [key.pem_location]

or is there more to it? Because I tried that and it did not work. When I tried accessing my domain, it would just load endlessly. Not sure if I did it incorrectly or if cloudflare is doing something weird here too.

A detail that might matter: I can only access my server through a custom port (port 1996). So, in other words, when I access the IP address, only port 1996 routes to my server, where caddy is running. Obviously, I cant route a domain name to a specific name (as far as I know), so when accessing my domain, I presume I have to write nizar.cf:1996/path for it to work. Not sure if this could be the source of the issue.

For context, I am unable to use port 80 for lets encrypt to work as normal, and using the DNS challenge did not work either because I am using a free domain, and cloudflare does not allow the use of their API for these domains. I thought to try this as a workaround.

I am thinking that I did it correctly, most likely, and the issue is coming from cloudflare. But I wanted to double check and be sure.

I don’t think that port is supported by Cloudflare. See Identifying network ports compatible with Cloudflare’s proxy

1 Like

Indeed.

If you must front your site with Cloudflare but cannot use default ports, I think the only option is a (paid) Argo Tunnel: https://www.cloudflare.com/en-au/products/argo-tunnel/

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