You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func (s *httpServer) handleCertificateHttpValidation(res http.ResponseWriter, req *http.Request) bool {
if certmagic.LooksLikeHTTPChallenge(req) {
for _, issuer := range *s.issuers {
if am, ok := issuer.(*certmagic.ACMEIssuer); ok {
if am.HandleHTTPChallenge(res, req) {
log.Debugf("handled ACME HTTP challenge for %s", req.Host)
return true
}
}
}
return false
}
if certmagic.LooksLikeZeroSSLHTTPValidation(req) {
for _, issuer := range *s.issuers {
if am, ok := issuer.(*certmagic.ZeroSSLIssuer); ok {
if am.HandleZeroSSLHTTPValidation(res, req) {
log.Debugf("handled ZeroSSL HTTP challenge for %s", req.Host)
return true
}
}
}
return false
}
return false
}
What did you expect to happen, and what actually happened instead?
From what I can see debugging further, the ACME issuer's are created with certmagic.NewACMEIssuer, which forward some parameters to the underlying issuer. For ZeroSSL there isn't such method from what I can see.
What's recommend, setting the Storage itself, or would a certmagic.NewZeroSSLIssuer helper method be preferred?
Ohh good find. Set the storage. I'll update things when I'm back at my desk. The package doesn't have a default ZeroSSL issuer like it does ACME issuer since you'll always need to provide an API key, but that kind of thing isn't required to use ACME. So setting a default storage for ZeroSSL may not make sense.
And I hate constructor functions when we can avoid them 😅
For now, I just made the Storage field required (and documented it as such) since it's simpler to store the verification info in storage whether distributed or not. In the future if I have more time (or a sponsor needs it), I can work on an implementation that doesn't require a Storage value.
What version of the package are you using?
v0.21.2
What are you trying to do?
We're trying to implement the newly added ZeroSSL API issuer, to allow SSL certificates for IP addresses.
What steps did you take?
We've implemented the issuer conform to the documentation and PR changes. In it's most basic form:
We handle the distributed HTTP challenge like:
What did you expect to happen, and what actually happened instead?
How do you think this should be fixed?
Setting the
Storage
on the issuer solves the issue. I would expect themagic.Storage
which is set globally to be used, like the ACME issuers.Please link to any related issues, pull requests, and/or discussion
#279
The text was updated successfully, but these errors were encountered: