Caddy with custom domain throws tls error

I have the following caddy file (I have Caddy2 installed and using Caddyfile) -

localhost {
	respond "Hello World !"
}

auth.demo.app.com {
	respond "Hello auth app"
}

When I do a sudo caddy reload I get the following error -

2021/01/23 08:05:07.347 ERROR tls job failed {“error”:
auth.demo.app.com: obtaining certificate: context canceled”}

this is the error I see in the log -

2021/01/23 08:08:22.981 ERROR tls.issuance.acme.acme_client challenge
failed {“identifier”: “auth.demo.app.com”, “challenge_type”:
“tls-alpn-01”, “status_code”: 400, “problem_type”:
“urn:ietf:params:acme:error:tls”, “error”: “remote error: tls: no
application protocol”} 2021/01/23
08:08:22.981 ERROR tls.issuance.acme.acme_client validating
authorization {“identifier”: “auth.demo.app.com”, “error”:
“authorization failed: HTTP 400 urn:ietf:params:acme:error:tls -
remote error: tls: no application protocol”, “order”:
https://acme-staging-v02.api.letsencrypt.org/acme/order/17665783/227021191”,
“attempt”: 1, “max_attempts”: 3}

Adding tls internal works but the log errors are still thrown. ie I can now access the url using curl https://auth.demo.app.com, however the error on caddy reload and in the log are still being thrown.

Take a look at these docs -

When you switch to internal, you are using the internal CA and not an external provider like LetsEncrypt.

Looks like the CA is not reaching Caddy when making a TLS connection to it. Make sure your DNS is properly configured, and your network/firewall too.

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