1. The problem I’m having:
I’ve setup caddy and it looks like I am unable to get an SSL certificate and when checking logs it looks like its stuck on trying to solve challenge.
2. Error messages and/or full log output:
ubuntu@nimbus2000:~$ sudo caddy run
2024/05/09 19:03:34.691 INFO using adjacent Caddyfile
2024/05/09 19:03:34.696 INFO admin admin endpoint started {"address": "localhost:2019", "enforce_origin": false, "origins": ["//localhost:2019", "//[::1]:2019", "//127.0.0.1:2019"]}
2024/05/09 19:03:34.696 INFO http.auto_https server is listening only on the HTTPS port but has no TLS connection policies; adding one to enable TLS {"server_name": "srv0", "https_port": 443}
2024/05/09 19:03:34.696 INFO http.auto_https enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2024/05/09 19:03:34.696 INFO tls.cache.maintenance started background certificate maintenance {"cache": "0x400038bc00"}
2024/05/09 19:03:34.697 INFO http enabling HTTP/3 listener {"addr": ":443"}
2024/05/09 19:03:34.697 INFO http.log server running {"name": "srv0", "protocols": ["h1", "h2", "h3"]}
2024/05/09 19:03:34.697 INFO http.log server running {"name": "remaining_auto_https_redirects", "protocols": ["h1", "h2", "h3"]}
2024/05/09 19:03:34.697 INFO http enabling automatic TLS certificate management {"domains": ["cloud.mydomain.com"]}
2024/05/09 19:03:34.698 INFO autosaved config (load with --resume flag) {"file": "/root/.config/caddy/autosave.json"}
2024/05/09 19:03:34.698 INFO serving initial configuration
2024/05/09 19:03:34.700 INFO tls.obtain acquiring lock {"identifier": "cloud.mydomain.com"}
2024/05/09 19:03:34.700 WARN tls storage cleaning happened too recently; skipping for now {"storage": "FileStorage:/root/.local/share/caddy", "instance": "db5da8d1-67d4-42b2-b8d7-55355c297bb1", "try_again": "2024/05/10 19:03:34.700", "try_again_in": 86399.99999972}
2024/05/09 19:03:34.700 INFO tls finished cleaning storage units
2024/05/09 19:03:34.704 INFO tls.obtain lock acquired {"identifier": "cloud.mydomain.com"}
2024/05/09 19:03:34.704 INFO tls.obtain obtaining certificate {"identifier": "cloud.mydomain.com"}
2024/05/09 19:03:36.093 INFO tls.issuance.acme waiting on internal rate limiter {"identifiers": ["cloud.mydomain.com"], "ca": "https://acme-v02.api.letsencrypt.org/directory", "account": "mail@mydomain.com"}
2024/05/09 19:03:36.093 INFO tls.issuance.acme done waiting on internal rate limiter {"identifiers": ["cloud.mydomain.com"], "ca": "https://acme-v02.api.letsencrypt.org/directory", "account": "cloud.mydomain.com"}
2024/05/09 19:03:36.905 INFO tls.issuance.acme.acme_client trying to solve challenge {"identifier": "cloud.mydomain.com", "challenge_type": "tls-alpn-01", "ca": "https://acme-v02.api.letsencrypt.org/directory"}
2024/05/09 19:03:37.778 ERROR tls.issuance.acme.acme_client challenge failed {"identifier": "cloud.mydomain.com", "challenge_type": "tls-alpn-01", "problem": {"type": "urn:ietf:params:acme:error:connection", "title": "", "detail": "myip: Error getting validation data", "instance": "", "subproblems": []}}
2024/05/09 19:03:37.778 ERROR tls.issuance.acme.acme_client validating authorization {"identifier": "cloud.mydomain.com", "problem": {"type": "urn:ietf:params:acme:error:connection", "title": "", "detail": "myip: Error getting validation data", "instance": "", "subproblems": []}, "order": "https://acme-v02.api.letsencrypt.org/acme/order/1717921447/267992625867", "attempt": 1, "max_attempts": 3}
2024/05/09 19:03:39.503 INFO tls.issuance.acme.acme_client trying to solve challenge {"identifier": "cloud.mydomain.com", "challenge_type": "http-01", "ca": "https://acme-v02.api.letsencrypt.org/directory"}
2024/05/09 19:03:40.324 ERROR tls.issuance.acme.acme_client challenge failed {"identifier": "cloud.mydomain.com", "challenge_type": "http-01", "problem": {"type": "urn:ietf:params:acme:error:connection", "title": "", "detail": "myip: Fetching http://cloud.mydomain.com/.well-known/acme-challenge/nGVdRQx2rZ1Y6CLc9OE5QIkBUX0iZLxtXGxwdae_OdI: Error getting validation data", "instance": "", "subproblems": []}}
2024/05/09 19:03:40.324 ERROR tls.issuance.acme.acme_client validating authorization {"identifier": "cloud.mydomain.com", "problem": {"type": "urn:ietf:params:acme:error:connection", "title": "", "detail": "myip: Fetching http://cloud.mydomain.com/.well-known/acme-challenge/nGVdRQx2rZ1Y6CLc9OE5QIkBUX0iZLxtXGxwdae_OdI: Error getting validation data", "instance": "", "subproblems": []}, "order": "https://acme-v02.api.letsencrypt.org/acme/order/1717921447/267992634357", "attempt": 2, "max_attempts": 3}
2024/05/09 19:03:40.324 ERROR tls.obtain could not get certificate from issuer {"identifier": "cloud.mydomain.com", "issuer": "acme-v02.api.letsencrypt.org-directory", "error": "HTTP 400 urn:ietf:params:acme:error:connection - myip: Fetching http://cloud.mydomain.com/.well-known/acme-challenge/nGVdRQx2rZ1Y6CLc9OE5QIkBUX0iZLxtXGxwdae_OdI: Error getting validation data"}
2024/05/09 19:03:41.726 INFO tls.issuance.zerossl generated EAB credentials {"key_id": "xjRJW2knHfJz_xs0Aq29Vg"}
2024/05/09 19:03:43.430 INFO tls.issuance.zerossl waiting on internal rate limiter {"identifiers": ["cloud.mydomain.com"], "ca": "https://acme.zerossl.com/v2/DV90", "account": "mail@mydomain.com,"}
2024/05/09 19:03:43.430 INFO tls.issuance.zerossl done waiting on internal rate limiter {"identifiers": ["cloud.mydomain.com"], "ca": "https://acme.zerossl.com/v2/DV90", "account": "mail@mydomain.com"}
2024/05/09 19:03:44.754 INFO tls.issuance.zerossl.acme_client trying to solve challenge {"identifier": "cloud.mydomain.com", "challenge_type": "http-01", "ca": "https://acme.zerossl.com/v2/DV90"}
3. Caddy version:
v2.7.6
4. How I installed and ran Caddy:
a. System environment:
Ubuntu 22.04, ARM, Docker installed with pi-hole and nextcloud running.
b. Command:
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy
d. My complete Caddy config:
{
email myemail
}
cloud.domain.com {
reverse_proxy localhost:11000
}