"failed to get certificate: acme: Error 400" when trying to run Caddy

Hi. I have downloaded Caddy on a CentOS VPS and I have been getting this error every time I try to run it.

Activating privacy features...2016/06/18 14:42:18 [my.url] failed to get certificate: acme: Error 400 - urn:acme:error:connection - Failed to connect to my.ip.addr.here:443 for TLS-SNI-01 challenge
Error Detail:
        Validation for my.url:443
        Resolved to:
        Used: my.ip.addr.here

Both the URL and the IP is correct and the URL resolves to the IP without a problem. My Caddyfile is as follows:

my.url {
    root /var/www/html

I have tried using tls off in my Caddyfile. When I run caddy with it, I get it running like this:

Activating privacy features... done.
Warning: File descriptor limit 1024 is too low for production sites. At least 4096 is recommended. Set with "ulimit -n 4096".

But I still cannot reach the website either directly with my.url or with my.url:2015.

I have tried to search for the problem on Google but all I got was similar errors from Cloudflare users; which I don’t use. I have OpenVPN on port 1194 and a Minecraft server on the same VM.

Does anyone have any idea about how I can solve this problem?

You need to open ports 80 and 443 for Caddy to obtain the certificates successfully; it won’t be able to through 1194.

This is documented at Automatic HTTPS.

I see. Thanks for your help, and for Caddy. :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.