Reject IP literal server name with TLS spoof

This commit is contained in:
世界 2026-04-16 18:00:13 +08:00
parent 043fdfad1d
commit 146f35483d
No known key found for this signature in database
GPG key ID: CD109927C34A63C4

View file

@ -30,7 +30,7 @@ func parseTLSSpoofOptions(serverName string, options option.OutboundTLSOptions)
if !tlsspoof.PlatformSupported {
return "", 0, E.New("`spoof` is not supported on this platform")
}
if options.DisableSNI || serverName == "" {
if options.DisableSNI || serverName == "" || M.ParseAddr(serverName).IsValid() {
return "", 0, E.New("`spoof` requires TLS ClientHello with SNI")
}
method, err := tlsspoof.ParseMethod(options.SpoofMethod)