remove the RequireAddressValidation callback from the Config (#4253)

This commit is contained in:
Marten Seemann
2024-01-22 21:24:07 -08:00
committed by GitHub
parent 892851eb8c
commit a2cf43d75c
14 changed files with 127 additions and 128 deletions

View File

@@ -37,6 +37,7 @@ func (w *responseWriter) WriteHeader(int) {}
type Server struct {
*http.Server
ForceRetry bool
QuicConfig *quic.Config
mutex sync.Mutex
@@ -68,7 +69,11 @@ func (s *Server) ListenAndServe() error {
tlsConf := s.TLSConfig.Clone()
tlsConf.NextProtos = []string{h09alpn}
ln, err := quic.ListenEarly(conn, tlsConf, s.QuicConfig)
tr := quic.Transport{Conn: conn}
if s.ForceRetry {
tr.MaxUnvalidatedHandshakes = -1
}
ln, err := tr.ListenEarly(tlsConf, s.QuicConfig)
if err != nil {
return err
}