TLS: without a default certificate, use the one for the server's hostname #450

Merged
jcoffey-dev merged 1 commits from fix/418-default-cert into main 2026-11-18 18:44:58 +00:00
1 Commits
Author SHA1 Message Date
jcoffey-dev 4e84dd1034 TLS: without a default certificate, use the one for the server's hostname
ci / fork-checks (pull_request) Skipped
ci / build (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 9m45s
With several certificates and no default set, every handshake without
SNI or for an unknown name logged tls.multiple-certificates-available at
Warn and got whichever certificate the hash map yielded first.

Loading the certificates now picks a default when none is set: the one
for defaultHostname (exact, then a wildcard on its domain), otherwise the
one whose name sorts first. The event is logged once per load, and only
when the hostname isn't covered.

Fixes #418
2026-11-18 11:34:23 -07:00