We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9ae5e71 commit 13bad86Copy full SHA for 13bad86
transport/internet/tls/ech.go
@@ -24,10 +24,11 @@ func ApplyECH(c *Config, config *tls.Config) error {
24
if len(c.EchConfig) > 0 {
25
ECHConfig = c.EchConfig
26
} else { // ECH config > DOH lookup
27
- if config.ServerName == "" {
28
- return newError("Using DOH for ECH needs serverName")
+ addr := net.ParseAddress(config.ServerName)
+ if !addr.Family().IsDomain() {
29
+ return newError("Using DOH for ECH needs SNI")
30
}
- ECHConfig, err = QueryRecord(c.ServerName, c.Ech_DOHserver)
31
+ ECHConfig, err = QueryRecord(addr.Domain(), c.Ech_DOHserver)
32
if err != nil {
33
return err
34
0 commit comments