mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-29 16:58:34 +00:00
Add: reject unknown SNI
Co-Authored-By: 玖柒Max <60207794+jiuqi9997@users.noreply.github.com>
This commit is contained in:
parent
1e3d739a5b
commit
53b99efe78
7 changed files with 63 additions and 27 deletions
|
@ -322,6 +322,7 @@ type TLSConfig struct {
|
|||
CipherSuites string `json:"cipherSuites"`
|
||||
PreferServerCipherSuites bool `json:"preferServerCipherSuites"`
|
||||
Fingerprint string `json:"fingerprint"`
|
||||
RejectUnknownSNI bool `json:"rejectUnknownSni"`
|
||||
}
|
||||
|
||||
// Build implements Buildable.
|
||||
|
@ -350,6 +351,7 @@ func (c *TLSConfig) Build() (proto.Message, error) {
|
|||
config.CipherSuites = c.CipherSuites
|
||||
config.PreferServerCipherSuites = c.PreferServerCipherSuites
|
||||
config.Fingerprint = strings.ToLower(c.Fingerprint)
|
||||
config.RejectUnknownSni = c.RejectUnknownSNI
|
||||
return config, nil
|
||||
}
|
||||
|
||||
|
@ -413,6 +415,7 @@ type XTLSConfig struct {
|
|||
MaxVersion string `json:"maxVersion"`
|
||||
CipherSuites string `json:"cipherSuites"`
|
||||
PreferServerCipherSuites bool `json:"preferServerCipherSuites"`
|
||||
RejectUnknownSNI bool `json:"rejectUnknownSni"`
|
||||
}
|
||||
|
||||
// Build implements Buildable.
|
||||
|
@ -440,6 +443,7 @@ func (c *XTLSConfig) Build() (proto.Message, error) {
|
|||
config.MaxVersion = c.MaxVersion
|
||||
config.CipherSuites = c.CipherSuites
|
||||
config.PreferServerCipherSuites = c.PreferServerCipherSuites
|
||||
config.RejectUnknownSni = c.RejectUnknownSNI
|
||||
return config, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue