1. Caddy version (caddy version
): V2, latest as of today
2. How I run Caddy:
LXC container
a. System environment:
Debian 10
b. Command:
caddy run --config /root/Caddyfile --adapter caddyfile
d. My complete Caddyfile or JSON config:
my.domain.name {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Xss-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Content-Security-Policy "upgrade-insecure-requests"
Referrer-Policy "strict-origin-when-cross-origin"
Cache-Control "public, max-age=15, must-revalidate"
Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; autoplay 'self'; camera 'none'; encrypted-media 'none'; fullscreen 'self'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture *; speaker 'none'; sync-xhr 'none'; usb 'none'; vr 'none'"
}
reverse_proxy 192.168.1.2:3456
tls {
dns cloudflare token_here
}
}
my2.domain.name {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Xss-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Content-Security-Policy "upgrade-insecure-requests"
Referrer-Policy "strict-origin-when-cross-origin"
Cache-Control "public, max-age=15, must-revalidate"
Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; autoplay 'self'; camera 'none'; encrypted-media 'none'; fullscreen 'self'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture *; speaker 'none'; sync-xhr 'none'; usb 'none'; vr 'none'"
}
@excludeDirs {
not path /local/dir1* /local/dir2* /local/dir3/* /local/file.db
}
reverse_proxy @excludeDirs 192.168.1.5:1892
tls {
dns cloudflare token_here
}
}
my3.domain.name {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Xss-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Content-Security-Policy "upgrade-insecure-requests"
Referrer-Policy "strict-origin-when-cross-origin"
Cache-Control "public, max-age=15, must-revalidate"
Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; autoplay 'self'; camera 'none'; encrypted-media 'none'; fullscreen 'self'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture *; speaker 'none'; sync-xhr 'none'; usb 'none'; vr 'none'"
}
reverse_proxy 192.168.1.81:2181
tls {
dns cloudflare token_here
}
}
my4.domain.name {
header {
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-Xss-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Content-Security-Policy "upgrade-insecure-requests"
Referrer-Policy "strict-origin-when-cross-origin"
Cache-Control "public, max-age=15, must-revalidate"
Feature-Policy "accelerometer 'none'; ambient-light-sensor 'none'; autoplay 'self'; camera 'none'; encrypted-media 'none'; fullscreen 'self'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; midi 'none'; payment 'none'; picture-in-picture *; speaker 'none'; sync-xhr 'none'; usb 'none'; vr 'none'"
}
reverse_proxy 192.168.1.50:9283
tls {
dns cloudflare token_here
}
}
3. The problem Iām having:
All of the domains in my Caddyfile get a SSL cert just fine, EXCEPT the first one. I just cannot get it to properly obtain an SSL certificate. Iāve tried for the last 3 days and every single time it fails. When I now visit the site I get error 525: SSL handshake failed. Hereās more information from Cloudflare on this error: https://support.cloudflare.com/hc/en-us/articles/115003011431#525error
4. Error messages and/or full log output:
This is the full output of when I try to run the caddy command.
root@caddy:~# /root/caddy run --config /root/Caddyfile --adapter caddyfile
2020/05/30 19:02:40.385 INFO using provided configuration {"config_file": "/root/Caddyfile2", "config_adapter": "caddyfile"}
2020/05/30 19:02:40.390 INFO admin admin endpoint started {"address": "tcp/localhost:2019", "enforce_origin": false, "origins": ["127.0.0.1:2019", "localhost:2019", "[::1]:2019"]}
2020/05/30 19:02:40.390 INFO http enabling automatic HTTP->HTTPS redirects {"server_name": "srv0"}
2020/05/30 14:02:40 [INFO][cache:0xc0007e71d0] Started certificate maintenance routine
2020/05/30 19:02:40.392 INFO tls cleaned up storage units
2020/05/30 19:02:40.392 INFO http enabling automatic TLS certificate management {"domains": ["my4.domain.name", "my.domain.name", "my3.domain.name", "my2.domain.name"]}
2020/05/30 19:02:40.400 INFO autosaved config {"file": "/root/.config/caddy/autosave.json"}
2020/05/30 19:02:40.400 INFO serving initial configuration
2020/05/30 14:02:40 [INFO][my.domain.name] Obtain certificate; acquiring lock...
2020/05/30 14:02:40 [INFO][my.domain.name] Obtain: Lock acquired; proceeding...
2020/05/30 14:02:40 [INFO][my.domain.name] Waiting on rate limiter...
2020/05/30 14:02:40 [INFO][my.domain.name] Done waiting
2020/05/30 14:02:40 [INFO] [my.domain.name] acme: Obtaining bundled SAN certificate given a CSR
2020/05/30 14:02:41 [INFO] [my.domain.name] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4914613081
2020/05/30 14:02:41 [INFO] [my.domain.name] acme: Could not find solver for: tls-alpn-01
2020/05/30 14:02:41 [INFO] [my.domain.name] acme: Could not find solver for: http-01
2020/05/30 14:02:41 [INFO] [my.domain.name] acme: use dns-01 solver
2020/05/30 14:02:41 [INFO] [my.domain.name] acme: Preparing to solve DNS-01
2020/05/30 14:02:41 [INFO] [my.domain.name] acme: Trying to solve DNS-01
2020/05/30 14:02:41 [INFO] [my.domain.name] acme: Checking DNS record propagation using [192.168.1.100:53 192.168.1.74:53]
2020/05/30 14:02:41 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2020/05/30 14:02:41 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:02:43 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:02:45 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:02:47 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:02:49 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:02:51 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:02:53 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:02:56 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:02:58 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:00 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:02 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:04 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:06 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:08 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:10 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:12 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:14 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:16 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:18 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:20 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:22 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:24 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:26 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:28 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:30 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:32 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:34 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:36 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:38 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:40 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:03:42 [INFO] [my.domain.name] acme: Cleaning DNS-01 challenge
2020/05/30 14:03:43 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4914613081
2020/05/30 14:03:43 [ERROR] error: one or more domains had a problem:
[my.domain.name] time limit exceeded: last error: NS dom.ns.cloudflare.com. returned SERVFAIL for _acme-challenge.my.domain.name.
(challenge=dns-01 remaining=[])
2020/05/30 14:03:45 [ERROR] attempt 1: [my.domain.name] Obtain: [my.domain.name] error: one or more domains had a problem:
[my.domain.name] time limit exceeded: last error: NS dom.ns.cloudflare.com. returned SERVFAIL for _acme-challenge.my.domain.name.
- retrying in 1m0s (1m4.764369248s/720h0m0s elapsed)...
2020/05/30 14:04:45 [INFO] [my.domain.name] acme: Obtaining bundled SAN certificate given a CSR
2020/05/30 14:04:45 [INFO] [my.domain.name] AuthURL: https://acme-staging-v02.api.letsencrypt.org/acme/authz-v3/60139893
2020/05/30 14:04:45 [INFO] [my.domain.name] acme: authorization already valid; skipping challenge
2020/05/30 14:04:45 [INFO] [my.domain.name] acme: Validations succeeded; requesting certificates
2020/05/30 14:04:46 [INFO] [my.domain.name] Server responded with a certificate.
2020/05/30 14:04:46 [INFO][my.domain.name] Waiting on rate limiter...
2020/05/30 14:04:46 [INFO][my.domain.name] Done waiting
2020/05/30 14:04:46 [INFO] [my.domain.name] acme: Obtaining bundled SAN certificate given a CSR
2020/05/30 14:04:49 [INFO] [my.domain.name] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4914644597
2020/05/30 14:04:49 [INFO] [my.domain.name] acme: Could not find solver for: tls-alpn-01
2020/05/30 14:04:49 [INFO] [my.domain.name] acme: Could not find solver for: http-01
2020/05/30 14:04:49 [INFO] [my.domain.name] acme: use dns-01 solver
2020/05/30 14:04:49 [INFO] [my.domain.name] acme: Preparing to solve DNS-01
2020/05/30 14:04:49 [INFO] [my.domain.name] acme: Trying to solve DNS-01
2020/05/30 14:04:49 [INFO] [my.domain.name] acme: Checking DNS record propagation using [192.168.1.100:53 192.168.1.74:53]
2020/05/30 14:04:49 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2020/05/30 14:04:49 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:04:51 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:04:53 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:04:55 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:04:57 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:04:59 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:01 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:03 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:05 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:07 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:09 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:11 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:13 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:15 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:17 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:19 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:21 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:24 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:26 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:28 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:30 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:32 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:34 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:36 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:36 http: TLS handshake error from 172.69.62.70:40746: no certificate available for 'my.domain.name'
2020/05/30 14:05:36 http: TLS handshake error from 173.245.54.167:31342: no certificate available for 'my.domain.name'
2020/05/30 14:05:38 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:40 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:42 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:44 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:46 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:48 [INFO] [my.domain.name] acme: Waiting for DNS record propagation.
2020/05/30 14:05:50 [INFO] [my.domain.name] acme: Cleaning DNS-01 challenge
2020/05/30 14:05:50 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/4914644597
2020/05/30 14:05:50 [ERROR] error: one or more domains had a problem:
[my.domain.name] time limit exceeded: last error: NS dom.ns.cloudflare.com. returned SERVFAIL for _acme-challenge.my.domain.name.
(challenge=dns-01 remaining=[])
2020/05/30 14:05:52 [INFO][my.domain.name] Obtain: Releasing lock
2020/05/30 14:05:52 [ERROR] my.domain.name: obtaining certificate: [my.domain.name] Obtain: [my.domain.name] error: one or more domains had a problem:
[my.domain.name] time limit exceeded: last error: NS dom.ns.cloudflare.com. returned SERVFAIL for _acme-challenge.my.domain.name.
2020/05/30 14:06:02 http: TLS handshake error from 162.158.78.56:53458: no certificate available for 'my.domain.name'
2020/05/30 14:13:05 http: TLS handshake error from 162.158.187.239:44524: no certificate available for 'my.domain.name'
2020/05/30 14:13:06 http: TLS handshake error from 162.158.187.239:44962: no certificate available for 'my.domain.name'
5. What I already tried:
Iāve tried this for the past 3 days and every time it fails for this one domain. Again, all the other 3 domains work just fine with a proper SSL cert. I have no idea why this one keeps failing.
How do I get it to work?