diff --git a/acme/client.go b/acme/client.go index 3851a69f..35dbcd64 100644 --- a/acme/client.go +++ b/acme/client.go @@ -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 } diff --git a/acme/http_challenge.go b/acme/http_challenge.go index a9f8e5cf..1cc1f6e1 100644 --- a/acme/http_challenge.go +++ b/acme/http_challenge.go @@ -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) diff --git a/acme/tls_sni_challenge.go b/acme/tls_sni_challenge.go index 2ab3abd0..dca886bd 100644 --- a/acme/tls_sni_challenge.go +++ b/acme/tls_sni_challenge.go @@ -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)