drop support for draft-29 (#3903)

This commit is contained in:
Marten Seemann 2023-06-21 13:06:44 +02:00 committed by GitHub
parent da298d09e1
commit 21388c86bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 65 additions and 189 deletions

View file

@ -54,7 +54,7 @@ var _ = Describe("Client", func() {
It("rejects quic.Configs that allow multiple QUIC versions", func() {
qconf := &quic.Config{
Versions: []quic.VersionNumber{protocol.VersionDraft29, protocol.Version1},
Versions: []quic.VersionNumber{protocol.Version2, protocol.Version1},
}
_, err := newClient("localhost:1337", nil, &roundTripperOpts{}, qconf, nil)
Expect(err).To(MatchError("can only use a single QUIC version for dialing a HTTP/3 connection"))

View file

@ -62,8 +62,6 @@ func versionToALPN(v protocol.VersionNumber) string {
switch v {
case protocol.Version1, protocol.Version2:
return NextProtoH3
case protocol.VersionDraft29:
return NextProtoH3Draft29
default:
return ""
}

View file

@ -779,13 +779,13 @@ var _ = Describe("Server", func() {
Context("setting http headers", func() {
BeforeEach(func() {
s.QuicConfig = &quic.Config{Versions: []protocol.VersionNumber{protocol.VersionDraft29}}
s.QuicConfig = &quic.Config{Versions: []protocol.VersionNumber{protocol.Version1}}
})
var ln1 QUICEarlyListener
var ln2 QUICEarlyListener
expected := http.Header{
"Alt-Svc": {`h3-29=":443"; ma=2592000`},
"Alt-Svc": {`h3=":443"; ma=2592000`},
}
addListener := func(addr string, ln *QUICEarlyListener) {
@ -840,9 +840,9 @@ var _ = Describe("Server", func() {
})
It("works if the quic.Config sets QUIC versions", func() {
s.QuicConfig.Versions = []quic.VersionNumber{quic.Version1, quic.VersionDraft29}
s.QuicConfig.Versions = []quic.VersionNumber{quic.Version1, quic.Version2}
addListener(":443", &ln1)
checkSetHeaders(Equal(http.Header{"Alt-Svc": {`h3=":443"; ma=2592000,h3-29=":443"; ma=2592000`}}))
checkSetHeaders(Equal(http.Header{"Alt-Svc": {`h3=":443"; ma=2592000`}}))
removeListener(&ln1)
checkSetHeaderError()
})
@ -850,7 +850,7 @@ var _ = Describe("Server", func() {
It("uses s.Port if set to a non-zero value", func() {
s.Port = 8443
addListener(":443", &ln1)
checkSetHeaders(Equal(http.Header{"Alt-Svc": {`h3-29=":8443"; ma=2592000`}}))
checkSetHeaders(Equal(http.Header{"Alt-Svc": {`h3=":8443"; ma=2592000`}}))
removeListener(&ln1)
checkSetHeaderError()
})
@ -870,8 +870,8 @@ var _ = Describe("Server", func() {
addListener(":443", &ln1)
addListener(":8443", &ln2)
checkSetHeaders(Or(
Equal(http.Header{"Alt-Svc": {`h3-29=":443"; ma=2592000,h3-29=":8443"; ma=2592000`}}),
Equal(http.Header{"Alt-Svc": {`h3-29=":8443"; ma=2592000,h3-29=":443"; ma=2592000`}}),
Equal(http.Header{"Alt-Svc": {`h3=":443"; ma=2592000,h3=":8443"; ma=2592000`}}),
Equal(http.Header{"Alt-Svc": {`h3=":8443"; ma=2592000,h3=":443"; ma=2592000`}}),
))
removeListener(&ln1)
removeListener(&ln2)
@ -929,17 +929,6 @@ var _ = Describe("Server", func() {
Expect(c.ConnectionState().TLS.ConnectionState.NegotiatedProtocol).To(Equal(NextProtoH3))
})
It("advertises h3-29 for draft-29", func() {
conf := ConfigureTLSConfig(testdata.GetTLSConfig())
ln, err := quic.ListenAddr("localhost:0", conf, &quic.Config{Versions: []quic.VersionNumber{quic.VersionDraft29}})
Expect(err).ToNot(HaveOccurred())
defer ln.Close()
c, err := quic.DialAddr(context.Background(), ln.Addr().String(), &tls.Config{InsecureSkipVerify: true, NextProtos: []string{NextProtoH3Draft29}}, nil)
Expect(err).ToNot(HaveOccurred())
defer c.CloseWithError(0, "")
Expect(c.ConnectionState().TLS.ConnectionState.NegotiatedProtocol).To(Equal(NextProtoH3Draft29))
})
It("sets the GetConfigForClient callback if no tls.Config is given", func() {
var receivedConf *tls.Config
quicListenAddr = func(addr string, tlsConf *tls.Config, _ *quic.Config) (QUICEarlyListener, error) {