1. The problem I’m having:
After an upgrade from 2.9.1
from 2.10.0
and the same Caddyfile
, TLS errors are returned for specifc (not on-demand) hostnames (hpb.yolo.asia
and web.cos.eu
in Caddyfile
) .
I found that adding tls force_automate
to these two blocks resolved the issue and is back running as it was with v2.9.1
.
Still, I wonder if this is the expected behavior in v2.10.0
or if it is a bug
2. Error messages and/or full log output:
{"level":"debug","ts":1750475797.387161,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"hpb.yolo.asia"}
{"level":"debug","ts":1750475797.387172,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.yolo.asia"}
{"level":"debug","ts":1750475797.3871813,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.*.asia"}
{"level":"debug","ts":1750475797.3871906,"logger":"tls.handshake","msg":"no matching certificates and no custom selection logic","identifier":"*.*.*"}
{"level":"debug","ts":1750475797.3872213,"logger":"tls.handshake","msg":"no certificate matching TLS ClientHello","remote_ip":"1.46.12.74","remote_port":"64295","server_name":"hpb.yolo.asia","remote":"1.46.12.74:64295","identifier":"hpb.yolo.asia","cipher_suites":[4865,4866,4867,49195,49196,52393,49199,49200,52392,49171,49172,156,157,47,53],"cert_cache_fill":0.0003,"load_or_obtain_if_necessary":true,"on_demand":false}
{"level":"debug","ts":1750475797.3872805,"logger":"http.stdlib","msg":"http: TLS handshake error from 1.46.12.74:64295: no certificate available for 'hpb.yolo.asia'"}
3. Caddy version:
v2.10.0 h1:fonubSaQKF1YANl8TXqGcn4IbIRUDdfAkpcsfI/vX5U=
4. How I installed and ran Caddy:
Installed via apt get (cloudsmith repo)
a. System environment:
Debian 12.11
b. Command:
systemctl start caddy
c. Service/unit/compose file:
The one provided by the package
[Unit]
Description=Caddy
Documentation=https://caddyserver.com/docs/
After=network.target network-online.target
Requires=network-online.target
[Service]
Type=notify
User=caddy
Group=caddy
ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile
ExecReload=/usr/bin/caddy reload --config /etc/caddy/Caddyfile --force
TimeoutStopSec=5s
LimitNOFILE=1048576
PrivateTmp=true
ProtectSystem=full
AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target
d. My complete Caddy config:
{
admin 127.0.0.1:8888
default_bind 127.0.0.1 [::1] 10.99.99.21 192.168.1.21
grace_period 3s
log {
output file /var/log/caddy/caddy.log {
roll_size 250MiB
roll_keep_for 15d
}
level ERROR
}
email contact@cos.eu
default_sni web.cos.eu
servers {
protocols h1 h2
}
on_demand_tls {
ask http://127.0.0.80/ask.php
}
}
(common) {
# Return client IP
@_client_ip {
path /_client_ip
}
respond @_client_ip "{client_ip}" 200 {
close
}
reverse_proxy http://127.0.0.80:80
}
(hsts) {
header Strict-Transport-Security max-age=15752000;
}
# Specific entry for main host
web.cos.eu {
import common
}
# Talk HPB for my.yolo.asia
hpb.yolo.asia {
route /standalone-signaling/* {
uri strip_prefix /standalone-signaling
reverse_proxy http://127.0.0.1:8181
}
import hsts
}
# Catch all routes for the rest of the domains
http:// {
import common
}
# Match only host names and not ip-addresses:
https://*.*,
https://*.*.*,
https://*.*.*.*,
https://*.*.*.*.*,
https://*.*.*.*.*.* {
tls {
on_demand
}
import hsts
import common
}
Thank you for your feedback!