mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-05-06 12:18:42 +00:00
ECH: client support TLS Encrypted Client Hello
This commit is contained in:
parent
87ab8e5128
commit
a0721f5174
5 changed files with 190 additions and 10 deletions
|
@ -412,6 +412,8 @@ type TLSConfig struct {
|
|||
MasterKeyLog string `json:"masterKeyLog"`
|
||||
ServerNameToVerify string `json:"serverNameToVerify"`
|
||||
VerifyPeerCertInNames []string `json:"verifyPeerCertInNames"`
|
||||
ECHConfig string `json:"echConfig"`
|
||||
ECHDOHServer string `json:"echDohServer"`
|
||||
}
|
||||
|
||||
// Build implements Buildable.
|
||||
|
@ -483,6 +485,15 @@ func (c *TLSConfig) Build() (proto.Message, error) {
|
|||
}
|
||||
config.VerifyPeerCertInNames = c.VerifyPeerCertInNames
|
||||
|
||||
if c.ECHConfig != "" {
|
||||
ECHConfig, err := base64.StdEncoding.DecodeString(c.ECHConfig)
|
||||
if err != nil {
|
||||
return nil, errors.New("invalid ECH Config", c.ECHConfig)
|
||||
}
|
||||
config.EchConfig = ECHConfig
|
||||
}
|
||||
config.Ech_DOHserver = c.ECHDOHServer
|
||||
|
||||
return config, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue