fix: ALPN not applied in uTLS/REALITY

This commit is contained in:
gVisor bot 2023-03-10 20:53:39 +08:00
parent 302ef3c6f7
commit adce5f1be9
3 changed files with 3 additions and 1 deletions

View File

@ -41,6 +41,7 @@ func GetRealityConn(ctx context.Context, conn net.Conn, ClientFingerprint string
}
uConfig := &utls.Config{
ServerName: tlsConfig.ServerName,
NextProtos: tlsConfig.NextProtos,
InsecureSkipVerify: true,
SessionTicketsDisabled: true,
VerifyPeerCertificate: verifier.VerifyPeerCertificate,

View File

@ -89,6 +89,7 @@ func copyConfig(c *tls.Config) *utls.Config {
return &utls.Config{
RootCAs: c.RootCAs,
ServerName: c.ServerName,
NextProtos: c.NextProtos,
InsecureSkipVerify: c.InsecureSkipVerify,
VerifyPeerCertificate: c.VerifyPeerCertificate,
}

View File

@ -217,7 +217,7 @@ func NewHTTP2Client(dialFn DialFn, tlsConfig *tls.Config, Fingerprint string, re
return utlsConn, nil
}
} else {
realityConn, err := tlsC.GetRealityConn(ctx, pconn, Fingerprint, tlsConfig, realityConfig)
realityConn, err := tlsC.GetRealityConn(ctx, pconn, Fingerprint, cfg, realityConfig)
if err != nil {
pconn.Close()
return nil, err