So it’s not working… surprise…
Caddyfile:
{ email my@email
domain.com:port {
tls {
dns lego_deprecated namecheap
}
header / {
Strict-Transport-Security "max-age=31536000; includeSubdomains"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Referrer-Policy "same-origin"
-Server
}
reverse_proxy / localhost:8123 {
}
sub.domain.com:port {
tls {
dns lego_deprecated namecheap
}
header / {
Strict-Transport-Security "max-age=31536000; includeSubdomains"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
Referrer-Policy "same-origin"
-Server
}
reverse_proxy / 10.90.11.150:8006 {
websocket
transparent
header_upstream Authorization {>Authorization}
}
}
I had to remove this in the reverse_proxy else it would not work at all
websocket
transparent
header_upstream Authorization {>Authorization}
Log:
2020/06/26 11:31:01 [INFO][domain.com] Obtain: Lock acquired; proceeding...
2020/06/26 11:31:01 [INFO][sub.domain.com] Obtain: Lock acquired; proceeding...
2020/06/26 11:31:02 [INFO] [domain.com] acme: Obtaining bundled SAN certificate given a CSR
2020/06/26 11:31:02 [INFO][domain.com] Waiting on rate limiter...
2020/06/26 11:31:02 [INFO][domain.com] Done waiting
2020/06/26 11:31:02 [INFO][sub.domain.com] Waiting on rate limiter...
2020/06/26 11:31:02 [INFO][sub.domain.com] Done waiting
2020/06/26 11:31:02 [INFO] [sub.domain.com] acme: Obtaining bundled SAN certificate given a CSR
2020/06/26 11:31:03 [INFO] [domain.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/5480097912
2020/06/26 11:31:03 [INFO] [domain.com] acme: Could not find solver for: tls-alpn-01
2020/06/26 11:31:03 [INFO] [domain.com] acme: Could not find solver for: http-01
2020/06/26 11:31:03 [INFO] [domain.com] acme: use dns-01 solver
2020/06/26 11:31:03 [INFO] [domain.com] acme: Preparing to solve DNS-01
2020/06/26 11:31:04 [INFO] [sub.domain.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/5480098140
2020/06/26 11:31:04 [INFO] [sub.domain.com] acme: Could not find solver for: tls-alpn-01
2020/06/26 11:31:04 [INFO] [sub.domain.com] acme: Could not find solver for: http-01
2020/06/26 11:31:04 [INFO] [sub.domain.com] acme: use dns-01 solver
2020/06/26 11:31:04 [INFO] [sub.domain.com] acme: Preparing to solve DNS-01
2020/06/26 11:31:05 [INFO] [domain.com] acme: Trying to solve DNS-01
2020/06/26 11:31:05 [INFO] [domain.com] acme: Checking DNS record propagation using [172.30.32.3:53]
2020/06/26 11:31:05 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2020/06/26 11:31:05 [INFO] [domain.com] acme: Waiting for DNS record propagation.
2020/06/26 11:31:05 [INFO] [sub.domain.com] acme: Trying to solve DNS-01
2020/06/26 11:31:05 [INFO] [sub.domain.com] acme: Checking DNS record propagation using [172.30.32.3:53]
2020/06/26 11:31:05 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2020/06/26 11:31:05 [INFO] [sub.domain.com] acme: Waiting for DNS record propagation.
2020/06/26 11:31:07 [INFO] [domain.com] acme: Waiting for DNS record propagation.
…
2020/06/26 11:32:04 [INFO] [domain.com] acme: Waiting for DNS record propagation.
2020/06/26 11:32:04 [INFO] [sub.domain.com] acme: Waiting for DNS record propagation.
2020/06/26 11:32:06 [INFO] [domain.com] acme: Cleaning DNS-01 challenge
2020/06/26 11:32:06 [INFO] [sub.domain.com] acme: Cleaning DNS-01 challenge
2020/06/26 11:32:06 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/5480097912
2020/06/26 11:32:06 [ERROR] error: one or more domains had a problem:
[domain.com] time limit exceeded: last error: NS dns2.registrar-servers.com. did not return the expected TXT record [fqdn: domain.com., value: brtk6ZaGnQXkSqfYIr3yKVedgm3y1K7GSvbLp0bWobQ]:
(challenge=dns-01 remaining=[])
2020/06/26 11:32:07 [INFO] Deactivating auth: https://acme-v02.api.letsencrypt.org/acme/authz-v3/5480098140
2020/06/26 11:32:07 [ERROR] error: one or more domains had a problem:
[sub.domain.com] time limit exceeded: last error: NS dns2.registrar-servers.com. did not return the expected TXT record [fqdn: domain.com., value: dbfIcwZ3fvfHjgrAU0NwX5_Ec3Cs942ibJZ9F00Nw5k]:
(challenge=dns-01 remaining=[])
2020/06/26 11:32:08 [ERROR] attempt 1: [domain.com] Obtain: [domain.com] error: one or more domains had a problem:
[domain.com] time limit exceeded: last error: NS dns2.registrar-servers.com. did not return the expected TXT record [fqdn: domain.com., value: brtk6ZaGnQXkSqfYIr3yKVedgm3y1K7GSvbLp0bWobQ]:
- retrying in 1m0s (1m6.86601971s/720h0m0s elapsed)...
2020/06/26 11:32:09 [ERROR] attempt 1: [sub.domain.com] Obtain: [sub.domain.com] error: one or more domains had a problem:
[sub.domain.com] time limit exceeded: last error: NS dns2.registrar-servers.com. did not return the expected TXT record [fqdn: domain.com., value: dbfIcwZ3fvfHjgrAU0NwX5_Ec3Cs942ibJZ9F00Nw5k]:
- retrying in 1m0s (1m7.436515271s/720h0m0s elapsed)...
til is set to 1 minute on the domain.
I can see Namecheap is getting the txt record. I have forwarded the port on my router and allowed loopback for the domain - basically everything is identical to how my Caddy1 domain is setup.
also log here… had to redo since scrolling up
INFO: Found custom Caddy
v2.0.0 h1:pQSaIJGFluFvu8KDGDODV8u4/QRED/OPyIR+MWYYse8=
INFO: Caddyfile found
{"level":"info","ts":1593135833.0462363,"msg":"using provided configuration","config_file":"/share/caddy/Caddyfile","config_adapter":""}
{"level":"info","ts":1593135833.0491917,"logger":"admin","msg":"admin endpoint started","address":"tcp/localhost:2019","enforce_origin":false,"origins":["localhost:2019","[::1]:2019","127.0.0.1:2019"]}
2020/06/26 11:43:53 [INFO][cache:0xc0004ebc20] Started certificate maintenance routine
{"level":"info","ts":1593135834.0106363,"logger":"http","msg":"enabling automatic HTTP->HTTPS redirects","server_name":"srv0"}
{"level":"info","ts":1593135834.011336,"logger":"tls","msg":"cleaned up storage units"}
{"level":"info","ts":1593135834.0116677,"logger":"http","msg":"enabling automatic TLS certificate management","domains":["sub.domain.com","domain.com"]}
{"level":"info","ts":1593135834.0119517,"msg":"autosaved config","file":"/data/caddy/autosave.json"}
{"level":"info","ts":1593135834.011969,"msg":"serving initial configuration"}
{"level":"info","ts":1593135834.0120137,"logger":"watcher","msg":"watching config file for changes","config_file":"/share/caddy/Caddyfile"}
2020/06/26 11:43:54 [INFO][sub.domain.com] Obtain certificate; acquiring lock...
2020/06/26 11:43:54 [INFO][FileStorage:/ssl/caddy] Lock for 'cert_acme_sub.domain.com_acme-v02.api.letsencrypt.org-directory' is stale (created: 2020-06-26 11:31:01.913017368 +1000 AEST, last update: 2020-06-26 11:32:36.926846976 +1000 AEST); removing then retrying: /ssl/caddy/locks/cert_acme_sub.domain.com_acme-v02.api.letsencrypt.org-directory.lock
2020/06/26 11:43:54 [INFO][domain.com] Obtain certificate; acquiring lock...
2020/06/26 11:43:54 [INFO][FileStorage:/ssl/caddy] Lock for 'cert_acme_domain.com_acme-v02.api.letsencrypt.org-directory' is stale (created: 2020-06-26 11:31:01.912995905 +1000 AEST, last update: 2020-06-26 11:32:36.926884598 +1000 AEST); removing then retrying: /ssl/caddy/locks/cert_acme_domain.com_acme-v02.api.letsencrypt.org-directory.lock
2020/06/26 11:43:54 [INFO][sub.domain.com] Obtain: Lock acquired; proceeding...
2020/06/26 11:43:54 [INFO][domain.com] Obtain: Lock acquired; proceeding...
2020/06/26 11:43:54 [INFO][domain.com] Waiting on rate limiter...
2020/06/26 11:43:54 [INFO][domain.com] Done waiting
2020/06/26 11:43:54 [INFO] [domain.com] acme: Obtaining bundled SAN certificate given a CSR
2020/06/26 11:43:54 [INFO] [sub.domain.com] acme: Obtaining bundled SAN certificate given a CSR
2020/06/26 11:43:54 [INFO][sub.domain.com] Waiting on rate limiter...
2020/06/26 11:43:54 [INFO][sub.domain.com] Done waiting
2020/06/26 11:43:55 [INFO] [domain.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/5480266595
2020/06/26 11:43:55 [INFO] [domain.com] acme: Could not find solver for: tls-alpn-01
2020/06/26 11:43:55 [INFO] [domain.com] acme: Could not find solver for: http-01
2020/06/26 11:43:55 [INFO] [domain.com] acme: use dns-01 solver
2020/06/26 11:43:55 [INFO] [domain.com] acme: Preparing to solve DNS-01
2020/06/26 11:43:56 [INFO] [sub.domain.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz-v3/5480266661
2020/06/26 11:43:56 [INFO] [sub.domain.com] acme: Could not find solver for: tls-alpn-01
2020/06/26 11:43:56 [INFO] [sub.domain.com] acme: Could not find solver for: http-01
2020/06/26 11:43:56 [INFO] [sub.domain.com] acme: use dns-01 solver
2020/06/26 11:43:56 [INFO] [sub.domain.com] acme: Preparing to solve DNS-01
2020/06/26 11:43:57 [INFO] [domain.com] acme: Trying to solve DNS-01
2020/06/26 11:43:57 [INFO] [domain.com] acme: Checking DNS record propagation using [172.30.32.3:53]
2020/06/26 11:43:57 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]
2020/06/26 11:43:57 [INFO] [domain.com] acme: Waiting for DNS record propagation.
2020/06/26 11:43:57 [INFO] [sub.domain.com] acme: Trying to solve DNS-01
2020/06/26 11:43:57 [INFO] [sub.domain.com] acme: Checking DNS record propagation using [172.30.32.3:53]
2020/06/26 11:43:57 [INFO] Wait for propagation [timeout: 1m0s, interval: 2s]