Browse Source

HTTP outbound: Read negotiated protocol from uTLS (#5251)

hax0r31337 2 weeks ago
parent
commit
e914183996
1 changed files with 6 additions and 0 deletions
  1. 6 0
      proxy/http/client.go

+ 6 - 0
proxy/http/client.go

@@ -308,6 +308,12 @@ func setUpHTTPTunnel(ctx context.Context, dest net.Destination, target string, u
 			return nil, err
 		}
 		nextProto = tlsConn.ConnectionState().NegotiatedProtocol
+	} else if tlsConn, ok := iConn.(*tls.UConn); ok {
+		if err := tlsConn.HandshakeContext(ctx); err != nil {
+			rawConn.Close()
+			return nil, err
+		}
+		nextProto = tlsConn.ConnectionState().NegotiatedProtocol
 	}
 
 	switch nextProto {