aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo@golang.org>2019-07-15 16:45:17 -0400
committerFilippo Valsorda <filippo@golang.org>2019-07-15 23:42:01 +0000
commit7a853b6520d83db3d018fe49cfac15324f45a1b2 (patch)
tree75fcba53f5ac863c8915d162e5178ff1c5b7b588
parent4128f163d6dca1b8d703da8cf86ef679608856a0 (diff)
downloadgo-7a853b6520d83db3d018fe49cfac15324f45a1b2.tar.gz
go-7a853b6520d83db3d018fe49cfac15324f45a1b2.zip
[release-branch.go1.11] crypto/tls: remove TestVerifyHostnameResumed
Session resumption is not a reliable TLS behavior: the server can decide to reject a session ticket for a number of reasons, or no reason at all. This makes this non-hermetic test extremely brittle. It's currently broken on the builders for both TLS 1.2 and TLS 1.3, and I could reproduce the issue for TLS 1.3 only. As I was debugging it, it started passing entirely on my machine. In practice, it doesn't get us any coverage as resumption is already tested with the recorded exchange tests, and TestVerifyHostname still provides a smoke test checking that we can in fact talk TLS. Updates #32978 Change-Id: I63505e22ff7704f25ad700d46e4ff14850ba5d3c Reviewed-on: https://go-review.googlesource.com/c/go/+/186239 Run-TryBot: Filippo Valsorda <filippo@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> (cherry-picked from 20e4540e9084528a1b36978882596daa7d8d8800) Reviewed-on: https://go-review.googlesource.com/c/go/+/186279 TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
-rw-r--r--src/crypto/tls/tls_test.go25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/crypto/tls/tls_test.go b/src/crypto/tls/tls_test.go
index 7542699bdc..354ace67bf 100644
--- a/src/crypto/tls/tls_test.go
+++ b/src/crypto/tls/tls_test.go
@@ -357,31 +357,6 @@ func TestVerifyHostname(t *testing.T) {
}
}
-func TestVerifyHostnameResumed(t *testing.T) {
- testenv.MustHaveExternalNetwork(t)
-
- config := &Config{
- ClientSessionCache: NewLRUClientSessionCache(32),
- }
- for i := 0; i < 2; i++ {
- c, err := Dial("tcp", "www.google.com:https", config)
- if err != nil {
- t.Fatalf("Dial #%d: %v", i, err)
- }
- cs := c.ConnectionState()
- if i > 0 && !cs.DidResume {
- t.Fatalf("Subsequent connection unexpectedly didn't resume")
- }
- if cs.VerifiedChains == nil {
- t.Fatalf("Dial #%d: cs.VerifiedChains == nil", i)
- }
- if err := c.VerifyHostname("www.google.com"); err != nil {
- t.Fatalf("verify www.google.com #%d: %v", i, err)
- }
- c.Close()
- }
-}
-
func TestConnCloseBreakingWrite(t *testing.T) {
ln := newLocalListener(t)
defer ln.Close()