mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 11:29:36 +03:00
Allow IP address ServerName when "serverName" is not configured
In this case, TLS Client Hello will not have SNI (RFC 6066, Section 3)
This commit is contained in:
@ -373,8 +373,8 @@ type Option func(*tls.Config)
|
||||
// WithDestination sets the server name in TLS config.
|
||||
func WithDestination(dest net.Destination) Option {
|
||||
return func(config *tls.Config) {
|
||||
if dest.Address.Family().IsDomain() && config.ServerName == "" {
|
||||
config.ServerName = dest.Address.Domain()
|
||||
if config.ServerName == "" {
|
||||
config.ServerName = dest.Address.String()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user