aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Shoemaker <roland@golang.org>2022-05-11 12:14:18 -0700
committerRoland Shoemaker <roland@golang.org>2022-05-11 20:02:25 +0000
commitc6db032c6c884ccc62755e1abf1214e99b8cea5f (patch)
treeb38a262f1cf37d14b8f3dea29bc7254495b864bf
parent2cf3adece1227c48e1673f1c37d70357e1a6b9d3 (diff)
downloadgo-x-crypto-c6db032c6c884ccc62755e1abf1214e99b8cea5f.tar.xz
acme/autocert/internal/acmetest: don't validate in goroutine
In the test server, rather than spawning a goroutine to validate challenges, block on the validation before responding to the client. This prevents a test race, where testing.T.Logf is called after the test is completed. While this has a slight behavioral difference to some production ACME server implementations (although is behavior allowed in the spec), the change has little material impact on what we are testing, since previously the validation would happen so quickly that it would be indistinguishable from the new blocking behavior (i.e. we would not be sending multiple requests during polling previously.) Fixes golang/go#52170 Change-Id: I75e3b2da69ddc2302be25a99f1b1151ed0f4af9b Reviewed-on: https://go-review.googlesource.com/c/crypto/+/405548 Run-TryBot: Roland Shoemaker <roland@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com>
-rw-r--r--acme/autocert/internal/acmetest/ca.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/acme/autocert/internal/acmetest/ca.go b/acme/autocert/internal/acmetest/ca.go
index fa33987..0a5ebe7 100644
--- a/acme/autocert/internal/acmetest/ca.go
+++ b/acme/autocert/internal/acmetest/ca.go
@@ -380,7 +380,7 @@ func (ca *CAServer) handle(w http.ResponseWriter, r *http.Request) {
ca.httpErrorf(w, http.StatusBadRequest, "challenge accept: %v", err)
return
}
- go ca.validateChallenge(a, typ)
+ ca.validateChallenge(a, typ)
w.Write([]byte("{}"))
// Get authorization status requests.