1. The problem I’m having:
- I have a server that get requests from domains without “www.” and redirect them to a new server that handle the same domain with “www.”. So the main goal of this specific server it to make a redirect to the "www."domain.
Everything is working good with “letsencrypt”, but when the server trying to use “zerossl” it gets errors all the time and can’t get a new certificate.
2. Error messages and/or full log output:
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"debug","ts":1695969570.2362342,"logger":"events","msg":"event","name":"tls_get_certificate","id":"e6d50ac0-ca47-4ec3-b02c-028857fec9bb","origin":"tls","data":{"client_hello":{"CipherSuites":[4866,4867,4865,49196,49200,159,52393,52392,52394,49195,49199,158,49188,49192,107,49187,49191,103,49162,49172,57,49161,49171,51,157,156,61,60,53,47,255],"ServerName":"myexampledomain.com","SupportedCurves":[29,23,30,25,24,256,257,258,259,260],"SupportedPoints":"AAEC","SignatureSchemes":[1027,1283,1539,2055,2056,2057,2058,2059,2052,2053,2054,1025,1281,1537,771,769,770,1026,1282,1538],"SupportedProtos":null,"SupportedVersions":[772,771],"Conn":{}}}}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"debug","ts":1695969570.2363062,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"myexampledomain.com"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"debug","ts":1695969570.2363138,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.com"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"debug","ts":1695969570.2363183,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.*"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"debug","ts":1695969570.239239,"logger":"tls","msg":"response from ask endpoint","domain":"myexampledomain.com","url":"https://www.admin-account-example.com/isDomainValid-nonWWW.asp?domain=myexampledomain.com","status":200}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"debug","ts":1695969570.2392607,"logger":"tls.handshake","msg":"all external certificate managers yielded no certificates and no errors","remote_ip":"206.189.57.110","remote_port":"36490","sni":"myexampledomain.com"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"debug","ts":1695969570.2393742,"logger":"tls.handshake","msg":"did not load cert from storage","remote_ip":"206.189.57.110","remote_port":"36490","server_name":"myexampledomain.com","error":"no matching certificate to load for myexampledomain.com: open /var/lib/caddy/.local/share/caddy/certificates/acme.zerossl.com-v2-dv90/wildcard_.com/wildcard_.com.key: no such file or directory"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"info","ts":1695969570.2393885,"logger":"tls.on_demand","msg":"obtaining new certificate","remote_ip":"206.189.57.110","remote_port":"36490","server_name":"myexampledomain.com"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"info","ts":1695969570.2396588,"logger":"tls.obtain","msg":"acquiring lock","identifier":"myexampledomain.com"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"info","ts":1695969570.2458105,"logger":"tls.obtain","msg":"lock acquired","identifier":"myexampledomain.com"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"info","ts":1695969570.2459261,"logger":"tls.obtain","msg":"obtaining certificate","identifier":"myexampledomain.com"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"debug","ts":1695969570.2459767,"logger":"events","msg":"event","name":"cert_obtaining","id":"75964cf8-e49f-4de4-b62f-65474cb1cdf1","origin":"tls","data":{"identifier":"myexampledomain.com"}}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"debug","ts":1695969570.2462652,"logger":"tls.obtain","msg":"trying issuer 1/2","issuer":"acme-v02.api.letsencrypt.org-directory"}
Sep 29 06:39:30 ip-10-0-1-67 caddy[374]: {"level":"info","ts":1695969570.2464483,"logger":"http","msg":"waiting on internal rate limiter","identifiers":["myexampledomain.com"],"ca":"https://acme-v02.api.letsencrypt.org/directory","account":"noam@admin-account-example.com"}
3. Caddy version:
v2.7.4
4. How I installed and ran Caddy:
a. System environment:
Ubuntu 22.04.3
d. My complete Caddy config:
{
debug
# TLS Options
email noam@admin-account-example.com
on_demand_tls {
ask https://www.admin-account-example.com/isDomainValid-nonWWW.asp
}
# Disable redirect
# auto_https disable_redirects
}
:443 {
tls noam@camelengine.com {
on_demand
}
redir http://www.{host}{uri}
}
:80 {
redir http://www.{host}{uri}
}