use the new crypto/tls QUIC Transport (#3860)

This commit is contained in:
Marten Seemann
2023-07-01 11:15:00 -07:00
committed by GitHub
parent 4998733ae1
commit 3d89e545d3
55 changed files with 2197 additions and 1509 deletions

View File

@@ -926,7 +926,7 @@ var _ = Describe("Server", func() {
c, err := quic.DialAddr(context.Background(), ln.Addr().String(), &tls.Config{InsecureSkipVerify: true, NextProtos: []string{NextProtoH3}}, nil)
Expect(err).ToNot(HaveOccurred())
defer c.CloseWithError(0, "")
Expect(c.ConnectionState().TLS.ConnectionState.NegotiatedProtocol).To(Equal(NextProtoH3))
Expect(c.ConnectionState().TLS.NegotiatedProtocol).To(Equal(NextProtoH3))
})
It("sets the GetConfigForClient callback if no tls.Config is given", func() {
@@ -954,7 +954,7 @@ var _ = Describe("Server", func() {
c, err := quic.DialAddr(context.Background(), ln.Addr().String(), &tls.Config{InsecureSkipVerify: true, NextProtos: []string{NextProtoH3}}, nil)
Expect(err).ToNot(HaveOccurred())
defer c.CloseWithError(0, "")
Expect(c.ConnectionState().TLS.ConnectionState.NegotiatedProtocol).To(Equal(NextProtoH3))
Expect(c.ConnectionState().TLS.NegotiatedProtocol).To(Equal(NextProtoH3))
})
It("works if GetConfigForClient returns a nil tls.Config", func() {
@@ -967,7 +967,7 @@ var _ = Describe("Server", func() {
c, err := quic.DialAddr(context.Background(), ln.Addr().String(), &tls.Config{InsecureSkipVerify: true, NextProtos: []string{NextProtoH3}}, nil)
Expect(err).ToNot(HaveOccurred())
defer c.CloseWithError(0, "")
Expect(c.ConnectionState().TLS.ConnectionState.NegotiatedProtocol).To(Equal(NextProtoH3))
Expect(c.ConnectionState().TLS.NegotiatedProtocol).To(Equal(NextProtoH3))
})
It("sets the ALPN for tls.Configs returned by the tls.GetConfigForClient, if it returns a static tls.Config", func() {
@@ -985,7 +985,7 @@ var _ = Describe("Server", func() {
c, err := quic.DialAddr(context.Background(), ln.Addr().String(), &tls.Config{InsecureSkipVerify: true, NextProtos: []string{NextProtoH3}}, nil)
Expect(err).ToNot(HaveOccurred())
defer c.CloseWithError(0, "")
Expect(c.ConnectionState().TLS.ConnectionState.NegotiatedProtocol).To(Equal(NextProtoH3))
Expect(c.ConnectionState().TLS.NegotiatedProtocol).To(Equal(NextProtoH3))
// check that the original config was not modified
Expect(tlsClientConf.NextProtos).To(Equal([]string{"foo", "bar"}))
})