Fatal error on startup with wildcard certificates#235
Labels
No labels
breaking
bug
build_pr_image
documentation
d̶u̶p̶l̶i̶c̶a̶t̶e̶
feature
good first issue
improvement
i̶n̶v̶a̶l̶i̶d̶
open questions
performance
refactor
research required
No project
No assignees
6 participants Notifications
Due date No due date set.
Dependencies
No dependencies set.
Reference
Codeberg/pages-server#235
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'm currently trying to deploy pages in a docker container built using the Dockerfile in the repo and using cloudflare for wildcard cert generation. On startup I'm getting the following error:
which seems to be related to following database interface code:
err := fmt.Errorf("domain key '%s' and cert domain '%s' not equal", name, c.Domain)Same problem for me :
I also ran into this issue, and found checking out the commit from the most recent release (v4.6.3) resolved it for me. I'm a bit confused since that was released 3 weeks ago and the two comments above me are older than that, but it's possible this issue was fixed but then re-introduced.
Is this fixed by using the latest version?
Unfortunately not
I ran into the same issue with OVH as my domain provider and the v5.1 release of pages-server
After some investigation, I believe the problem comes from
if useDnsProvider && domains[0] != "" && domains[0][0] == '*' {domains = domains[1:]}:
When requesting the main certificate, wildcard domain is explicitly removed from the requested domains, leading to the request of a non-wildcard certificate:
When removing the 3 lines from the code, the certificate requested now match the one used in prod by codeberg.page:
Because of
if renew != nil && renew.CertURL != "" {if c.acmeUseRateLimits {c.acmeClientRequestLimit.Take()}log.Debug().Msgf("Renewing certificate for: %v", domains)res, err = acmeClient.Certificate.Renew(*renew, true, false, ""), an instance with an already valid cert will keep renewing the valid cert and not run into this issue, but a new instance is not able to generate a new certificate.