Skip to content

Commit

Permalink
DNS over QUIC should not have "http/1.1" and "h2" ALPNs (#2570)
Browse files Browse the repository at this point in the history
  • Loading branch information
dyhkwong committed Jun 28, 2023
1 parent 2ac0188 commit cd9f183
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions app/dns/nameserver_quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (

"github.com/quic-go/quic-go"
"golang.org/x/net/dns/dnsmessage"
"golang.org/x/net/http2"

"github.com/v2fly/v2ray-core/v5/common"
"github.com/v2fly/v2ray-core/v5/common/buf"
Expand All @@ -25,7 +24,7 @@ import (
)

// NextProtoDQ - During connection establishment, DNS/QUIC support is indicated
// by selecting the ALPN token "dq" in the crypto handshake.
// by selecting the ALPN token "doq" in the crypto handshake.
const NextProtoDQ = "doq"

const handshakeIdleTimeout = time.Second * 8
Expand Down Expand Up @@ -383,7 +382,7 @@ func (s *QUICNameServer) openConnection(ctx context.Context) (quic.Connection, e
HandshakeIdleTimeout: handshakeIdleTimeout,
}

conn, err := quic.DialAddrContext(ctx, s.destination.NetAddr(), tlsConfig.GetTLSConfig(tls.WithNextProto("http/1.1", http2.NextProtoTLS, NextProtoDQ)), quicConfig)
conn, err := quic.DialAddrContext(ctx, s.destination.NetAddr(), tlsConfig.GetTLSConfig(tls.WithNextProto(NextProtoDQ)), quicConfig)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit cd9f183

Please sign in to comment.