From 87bd03816a806fbdc8338e541f3720782e3dfb27 Mon Sep 17 00:00:00 2001 From: Fangliding Date: Mon, 16 Nov 2026 08:43:03 +0800 Subject: [PATCH] TLS handshake timeout --- transport/internet/tls/tls.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/transport/internet/tls/tls.go b/transport/internet/tls/tls.go index 07c214b43..0a68a5924 100644 --- a/transport/internet/tls/tls.go +++ b/transport/internet/tls/tls.go @@ -103,6 +103,13 @@ func (c *UConn) Close() error { return c.Conn.Close() } +func (c *UConn) HandshakeContext(ctx context.Context) error { + // Chrome の default handshake timeout + ctx, cancel := context.WithTimeout(ctx, 30*time.Second) + defer cancel() + return c.UConn.HandshakeContext(ctx) +} + func (c *UConn) HandshakeContextServerName(ctx context.Context) string { if err := c.HandshakeContext(ctx); err != nil { return ""