mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-02-20 23:47:21 -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 {
|
if len(c.EchConfig) > 0 {
|
||||||
ECHConfig = c.EchConfig
|
ECHConfig = c.EchConfig
|
||||||
} else { // ECH config > DOH lookup
|
} else { // ECH config > DOH lookup
|
||||||
if config.ServerName == "" {
|
addr := net.ParseAddress(config.ServerName)
|
||||||
return newError("Using DOH for ECH needs 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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user