forked from TrueCloudLab/lego
Take the magic out of defaulting to the Server implementations of HTTP-01 and TLS-SNI-01
This commit is contained in:
parent
7475e7f9c2
commit
21de29e902
3 changed files with 2 additions and 10 deletions
|
@ -95,8 +95,8 @@ func NewClient(caDirURL string, user User, keyBits int) (*Client, error) {
|
|||
// Add all available solvers with the right index as per ACME
|
||||
// spec to this map. Otherwise they won`t be found.
|
||||
solvers := make(map[Challenge]solver)
|
||||
solvers[HTTP01] = &httpChallenge{jws: jws, validate: validate}
|
||||
solvers[TLSSNI01] = &tlsSNIChallenge{jws: jws, validate: validate}
|
||||
solvers[HTTP01] = &httpChallenge{jws: jws, validate: validate, provider: &HTTPProviderServer{}}
|
||||
solvers[TLSSNI01] = &tlsSNIChallenge{jws: jws, validate: validate, provider: &TLSProviderServer{}}
|
||||
|
||||
return &Client{directory: dir, user: user, jws: jws, keyBits: keyBits, solvers: solvers}, nil
|
||||
}
|
||||
|
|
|
@ -26,10 +26,6 @@ func (s *httpChallenge) Solve(chlng challenge, domain string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if s.provider == nil {
|
||||
s.provider = &httpChallengeServer{}
|
||||
}
|
||||
|
||||
err = s.provider.Present(domain, chlng.Token, keyAuth)
|
||||
if err != nil {
|
||||
return fmt.Errorf("[%s] error presenting token: %v", domain, err)
|
||||
|
|
|
@ -27,10 +27,6 @@ func (t *tlsSNIChallenge) Solve(chlng challenge, domain string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if t.provider == nil {
|
||||
t.provider = &tlsSNIChallengeServer{}
|
||||
}
|
||||
|
||||
err = t.provider.Present(domain, chlng.Token, keyAuth)
|
||||
if err != nil {
|
||||
return fmt.Errorf("[%s] error presenting token: %v", domain, err)
|
||||
|
|
Loading…
Reference in a new issue