Skip to content

Commit

Permalink
Add warning on using old version of XTLS
Browse files Browse the repository at this point in the history
And checks param `fingerprint` also
  • Loading branch information
RPRX committed Feb 3, 2023
1 parent b57d3fa commit fa7300e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions infra/conf/transport_internet.go
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ type XTLSConfig struct {
MaxVersion string `json:"maxVersion"`
CipherSuites string `json:"cipherSuites"`
PreferServerCipherSuites bool `json:"preferServerCipherSuites"`
Fingerprint string `json:"fingerprint"`
RejectUnknownSNI bool `json:"rejectUnknownSni"`
PinnedPeerCertificateChainSha256 *[]string `json:"pinnedPeerCertificateChainSha256"`
}
Expand Down Expand Up @@ -487,6 +488,9 @@ func (c *XTLSConfig) Build() (proto.Message, error) {
config.MaxVersion = c.MaxVersion
config.CipherSuites = c.CipherSuites
config.PreferServerCipherSuites = c.PreferServerCipherSuites
if c.Fingerprint != "" {
return nil, newError(`Old version of XTLS does not support fingerprint. Please use flow "xtls-rprx-vision" with "tls & tlsSettings" instead.`)
}
config.RejectUnknownSni = c.RejectUnknownSNI

if c.PinnedPeerCertificateChainSha256 != nil {
Expand All @@ -500,6 +504,8 @@ func (c *XTLSConfig) Build() (proto.Message, error) {
}
}

newError(`You are using an old version of XTLS, which is deprecated now and will be removed soon. Please use flow "xtls-rprx-vision" with "tls & tlsSettings" instead.`).AtWarning().WriteToLog()

return config, nil
}

Expand Down

1 comment on commit fa7300e

@zuig
Copy link

@zuig zuig commented on fa7300e Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xtls-rprx-vision 在ios上配置很麻烦,小火箭都用不了

Please sign in to comment.