mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-12-01 14:18:36 +00:00
Apply handshake timeout to ShadowTLS v3 standard TLS handshake
This commit is contained in:
@@ -76,7 +76,13 @@ func NewOutbound(ctx context.Context, router adapter.Router, logger log.ContextL
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tlsHandshakeFunc = shadowtls.DefaultTLSHandshakeFunc(options.Password, stdTLSConfig)
|
||||
defaultHandshakeFunc := shadowtls.DefaultTLSHandshakeFunc(options.Password, stdTLSConfig)
|
||||
handshakeTimeout := tlsConfig.HandshakeTimeout()
|
||||
tlsHandshakeFunc = func(ctx context.Context, conn net.Conn, sessionIDGenerator shadowtls.TLSSessionIDGeneratorFunc) error {
|
||||
ctx, cancel := context.WithTimeout(ctx, handshakeTimeout)
|
||||
defer cancel()
|
||||
return defaultHandshakeFunc(ctx, conn, sessionIDGenerator)
|
||||
}
|
||||
}
|
||||
}
|
||||
outboundDialer, err := dialer.New(ctx, options.DialerOptions, options.ServerIsDomain())
|
||||
|
||||
Reference in New Issue
Block a user