mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 05:29:50 +00:00
REALITY, TLS config: Set "chrome" as the default fingerprint
Other VLESS implementations should follow this change.
This commit is contained in:
parent
5836afc41f
commit
96fb680d45
@ -165,7 +165,7 @@ func (c *WebSocketConfig) Build() (proto.Message, error) {
|
|||||||
}
|
}
|
||||||
// Priority (client): host > serverName > address
|
// Priority (client): host > serverName > address
|
||||||
for k, v := range c.Headers {
|
for k, v := range c.Headers {
|
||||||
if strings.ToLower(k) == "host"{
|
if strings.ToLower(k) == "host" {
|
||||||
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
|
errors.PrintDeprecatedFeatureWarning(`"host" in "headers"`, `independent "host"`)
|
||||||
if c.Host == "" {
|
if c.Host == "" {
|
||||||
c.Host = v
|
c.Host = v
|
||||||
@ -438,7 +438,7 @@ func (c *TLSConfig) Build() (proto.Message, error) {
|
|||||||
config.MaxVersion = c.MaxVersion
|
config.MaxVersion = c.MaxVersion
|
||||||
config.CipherSuites = c.CipherSuites
|
config.CipherSuites = c.CipherSuites
|
||||||
config.Fingerprint = strings.ToLower(c.Fingerprint)
|
config.Fingerprint = strings.ToLower(c.Fingerprint)
|
||||||
if config.Fingerprint != "" && tls.GetFingerprint(config.Fingerprint) == nil {
|
if config.Fingerprint != "unsafe" && tls.GetFingerprint(config.Fingerprint) == nil {
|
||||||
return nil, errors.New(`unknown fingerprint: `, config.Fingerprint)
|
return nil, errors.New(`unknown fingerprint: `, config.Fingerprint)
|
||||||
}
|
}
|
||||||
config.RejectUnknownSni = c.RejectUnknownSNI
|
config.RejectUnknownSni = c.RejectUnknownSNI
|
||||||
@ -584,15 +584,13 @@ func (c *REALITYConfig) Build() (proto.Message, error) {
|
|||||||
config.ServerNames = c.ServerNames
|
config.ServerNames = c.ServerNames
|
||||||
config.MaxTimeDiff = c.MaxTimeDiff
|
config.MaxTimeDiff = c.MaxTimeDiff
|
||||||
} else {
|
} else {
|
||||||
if c.Fingerprint == "" {
|
config.Fingerprint = strings.ToLower(c.Fingerprint)
|
||||||
return nil, errors.New(`empty "fingerprint"`)
|
if config.Fingerprint == "unsafe" || config.Fingerprint == "hellogolang" {
|
||||||
}
|
|
||||||
if config.Fingerprint = strings.ToLower(c.Fingerprint); tls.GetFingerprint(config.Fingerprint) == nil {
|
|
||||||
return nil, errors.New(`unknown "fingerprint": `, config.Fingerprint)
|
|
||||||
}
|
|
||||||
if config.Fingerprint == "hellogolang" {
|
|
||||||
return nil, errors.New(`invalid "fingerprint": `, config.Fingerprint)
|
return nil, errors.New(`invalid "fingerprint": `, config.Fingerprint)
|
||||||
}
|
}
|
||||||
|
if tls.GetFingerprint(config.Fingerprint) == nil {
|
||||||
|
return nil, errors.New(`unknown "fingerprint": `, config.Fingerprint)
|
||||||
|
}
|
||||||
if len(c.ServerNames) != 0 {
|
if len(c.ServerNames) != 0 {
|
||||||
return nil, errors.New(`non-empty "serverNames", please use "serverName" instead`)
|
return nil, errors.New(`non-empty "serverNames", please use "serverName" instead`)
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ func init() {
|
|||||||
|
|
||||||
func GetFingerprint(name string) (fingerprint *utls.ClientHelloID) {
|
func GetFingerprint(name string) (fingerprint *utls.ClientHelloID) {
|
||||||
if name == "" {
|
if name == "" {
|
||||||
return
|
return &utls.HelloChrome_Auto
|
||||||
}
|
}
|
||||||
if fingerprint = PresetFingerprints[name]; fingerprint != nil {
|
if fingerprint = PresetFingerprints[name]; fingerprint != nil {
|
||||||
return
|
return
|
||||||
@ -191,6 +191,7 @@ var PresetFingerprints = map[string]*utls.ClientHelloID{
|
|||||||
"qq": &utls.HelloQQ_Auto,
|
"qq": &utls.HelloQQ_Auto,
|
||||||
"random": nil,
|
"random": nil,
|
||||||
"randomized": nil,
|
"randomized": nil,
|
||||||
|
"unsafe": nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
var ModernFingerprints = map[string]*utls.ClientHelloID{
|
var ModernFingerprints = map[string]*utls.ClientHelloID{
|
||||||
|
Loading…
Reference in New Issue
Block a user