mirror of
https://github.com/caddyserver/caddy.git
synced 2026-07-31 01:17:48 -04:00
In https://github.com/caddyserver/caddy/pull/7057, the behavior of `KeyPair.Load` was changed to return a certificate chain. While the change was primarily meant for intermediates, it also affected how a root (or roots) were loaded. The existing error handling logic relied on a shared `err != nil` check, but with the new behavior there's no guarantee that there's actually a root in the PEM file on disk. This commit handles the error immediately after reading the PEM from disk. Fixes: #7895