mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-11-10 21:21:02 +08:00
Fix TLS sniffer storing IP literal server names as domain
This commit is contained in:
1 file changed
+2
-1
+2
-1
@@ -10,6 +10,7 @@ import (
|
||||
C "github.com/sagernet/sing-box/constant"
|
||||
"github.com/sagernet/sing/common/bufio"
|
||||
E "github.com/sagernet/sing/common/exceptions"
|
||||
M "github.com/sagernet/sing/common/metadata"
|
||||
)
|
||||
|
||||
func TLSClientHello(ctx context.Context, metadata *adapter.InboundContext, reader io.Reader) error {
|
||||
@@ -22,7 +23,7 @@ func TLSClientHello(ctx context.Context, metadata *adapter.InboundContext, reade
|
||||
}).HandshakeContext(ctx)
|
||||
if clientHello != nil {
|
||||
metadata.Protocol = C.ProtocolTLS
|
||||
metadata.Domain = clientHello.ServerName
|
||||
metadata.Domain = M.ParseSocksaddrHostPort(clientHello.ServerName, 0).Fqdn
|
||||
return nil
|
||||
}
|
||||
if errors.Is(err, io.ErrUnexpectedEOF) {
|
||||
|
||||
Reference in new issue
Block a user