mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
Fix the use of ServerName in ECH config (#3188)
This commit is contained in:
parent
9ae5e71711
commit
13bad86c3b
@ -24,10 +24,11 @@ func ApplyECH(c *Config, config *tls.Config) error {
|
||||
if len(c.EchConfig) > 0 {
|
||||
ECHConfig = c.EchConfig
|
||||
} else { // ECH config > DOH lookup
|
||||
if config.ServerName == "" {
|
||||
return newError("Using DOH for ECH needs serverName")
|
||||
addr := net.ParseAddress(config.ServerName)
|
||||
if !addr.Family().IsDomain() {
|
||||
return newError("Using DOH for ECH needs SNI")
|
||||
}
|
||||
ECHConfig, err = QueryRecord(c.ServerName, c.Ech_DOHserver)
|
||||
ECHConfig, err = QueryRecord(addr.Domain(), c.Ech_DOHserver)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user