diff --git a/acme/client_test.go b/acme/client_test.go index c5c32672..cd89b257 100644 --- a/acme/client_test.go +++ b/acme/client_test.go @@ -130,15 +130,15 @@ func TestValidate(t *testing.T) { }{ {"POST-unexpected", []string{"weird"}, "unexpected"}, {"POST-valid", []string{"valid"}, ""}, - {"POST-invalid", []string{"invalid"}, "not validate"}, + {"POST-invalid", []string{"invalid"}, "Error Detail"}, {"GET-unexpected", []string{"pending", "weird"}, "unexpected"}, {"GET-valid", []string{"pending", "valid"}, ""}, - {"GET-invalid", []string{"pending", "invalid"}, "not validate"}, + {"GET-invalid", []string{"pending", "invalid"}, "Error Detail"}, } for _, tst := range tsts { statuses = tst.statuses - if err := validate(j, ts.URL, challenge{Type: "http-01", Token: "token"}); err == nil && tst.want != "" { + if err := validate(j, "example.com", ts.URL, challenge{Type: "http-01", Token: "token"}); err == nil && tst.want != "" { t.Errorf("[%s] validate: got error %v, want something with %q", tst.name, err, tst.want) } else if err != nil && !strings.Contains(err.Error(), tst.want) { t.Errorf("[%s] validate: got error %v, want something with %q", tst.name, err, tst.want) @@ -161,7 +161,7 @@ func writeJSONResponse(w http.ResponseWriter, body interface{}) { } // stubValidate is like validate, except it does nothing. -func stubValidate(j *jws, uri string, chlng challenge) error { +func stubValidate(j *jws, domain, uri string, chlng challenge) error { return nil } diff --git a/acme/http_challenge_test.go b/acme/http_challenge_test.go index 759967d0..97a9d979 100644 --- a/acme/http_challenge_test.go +++ b/acme/http_challenge_test.go @@ -12,7 +12,7 @@ func TestHTTPChallenge(t *testing.T) { privKey, _ := generatePrivateKey(rsakey, 512) j := &jws{privKey: privKey.(*rsa.PrivateKey)} clientChallenge := challenge{Type: "http-01", Token: "http1"} - mockValidate := func(_ *jws, _ string, chlng challenge) error { + mockValidate := func(_ *jws, _, _ string, chlng challenge) error { uri := "http://localhost:23457/.well-known/acme-challenge/" + chlng.Token resp, err := http.Get(uri) if err != nil { diff --git a/acme/tls_sni_challenge_test.go b/acme/tls_sni_challenge_test.go index c90d9ab3..8f3ccbe1 100644 --- a/acme/tls_sni_challenge_test.go +++ b/acme/tls_sni_challenge_test.go @@ -14,7 +14,7 @@ func TestTLSSNIChallenge(t *testing.T) { privKey, _ := generatePrivateKey(rsakey, 512) j := &jws{privKey: privKey.(*rsa.PrivateKey)} clientChallenge := challenge{Type: "tls-sni-01", Token: "tlssni1"} - mockValidate := func(_ *jws, _ string, chlng challenge) error { + mockValidate := func(_ *jws, _, _ string, chlng challenge) error { conn, err := tls.Dial("tcp", "localhost:23457", &tls.Config{ InsecureSkipVerify: true, })