never allow 0-RTT when using Dial, even if the session ticket allows it (#4125)

When resuming a TLS session using Dial (and not DialEarly), 0-RTT should
be disabled at the TLS layer, even if the session ticket allows for
0-RTT resumption.

This bug is not critical, since Dial doesn't return an EarlyConnection,
so the client wouldn't be able to actually send 0-RTT data in practice.
This commit is contained in:
Marten Seemann
2023-10-25 22:20:23 +07:00
committed by GitHub
parent 1bcec70978
commit 746290b78a
11 changed files with 93 additions and 14 deletions

View File

@@ -41,7 +41,10 @@ var _ = Describe("Client Session Cache", func() {
ClientSessionCache: &clientSessionCache{
wrapped: tls.NewLRUClientSessionCache(10),
getData: func() []byte { return []byte("session") },
setData: func(data []byte) { restored <- data },
setData: func(data []byte) bool {
restored <- data
return true
},
},
}
conn, err := tls.Dial(