ECH: client support TLS Encrypted Client Hello

This commit is contained in:
风扇滑翔翼 2025-02-08 10:07:42 +00:00 committed by GitHub
parent 87ab8e5128
commit a0721f5174
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 190 additions and 10 deletions

View file

@ -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
}