1
0
Fork 0

Disable QUIC 0-RTT

Co-authored-by: Julien Salleyron <julien.salleyron@gmail.com>
This commit is contained in:
Michael 2024-07-02 10:48:04 +02:00 committed by GitHub
parent 98c624bf1a
commit 900784a95a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 140 additions and 25 deletions

View file

@ -9,6 +9,7 @@ import (
"net/http"
"sync"
"github.com/quic-go/quic-go"
"github.com/quic-go/quic-go/http3"
"github.com/traefik/traefik/v2/pkg/config/static"
"github.com/traefik/traefik/v2/pkg/log"
@ -50,12 +51,15 @@ func newHTTP3Server(ctx context.Context, configuration *static.EntryPoint, https
Port: configuration.HTTP3.AdvertisedPort,
Handler: httpsServer.Server.(*http.Server).Handler,
TLSConfig: &tls.Config{GetConfigForClient: h3.getGetConfigForClient},
QUICConfig: &quic.Config{
Allow0RTT: false,
},
}
previousHandler := httpsServer.Server.(*http.Server).Handler
httpsServer.Server.(*http.Server).Handler = http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) {
if err := h3.Server.SetQuicHeaders(rw.Header()); err != nil {
if err := h3.Server.SetQUICHeaders(rw.Header()); err != nil {
log.FromContext(ctx).Errorf("Failed to set HTTP3 headers: %v", err)
}