Add server support

This commit is contained in:
风扇滑翔翼 2025-03-01 19:23:56 +00:00 committed by GitHub
parent 9723ed9ecd
commit c10e5f6c78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 87 additions and 40 deletions

View file

@ -414,6 +414,7 @@ type TLSConfig struct {
VerifyPeerCertInNames []string `json:"verifyPeerCertInNames"`
ECHConfig string `json:"echConfig"`
ECHDOHServer string `json:"echDohServer"`
EchKeySets string `json:"echKeySets"`
}
// Build implements Buildable.
@ -492,6 +493,13 @@ func (c *TLSConfig) Build() (proto.Message, error) {
}
config.EchConfig = ECHConfig
}
if c.EchKeySets != "" {
EchPrivateKey, err := base64.StdEncoding.DecodeString(c.EchKeySets)
if err != nil {
return nil, errors.New("invalid ECH Config", c.EchKeySets)
}
config.EchKeySets = EchPrivateKey
}
config.Ech_DOHserver = c.ECHDOHServer
return config, nil