ODoH servers should not require a static configuration

This commit is contained in:
Frank Denis 2021-06-07 13:21:58 +02:00
parent 7980af6f46
commit 29613096da
3 changed files with 10 additions and 1 deletions

View File

@ -79,6 +79,7 @@ type Config struct {
SourceRequireNoFilter bool `toml:"require_nofilter"` SourceRequireNoFilter bool `toml:"require_nofilter"`
SourceDNSCrypt bool `toml:"dnscrypt_servers"` SourceDNSCrypt bool `toml:"dnscrypt_servers"`
SourceDoH bool `toml:"doh_servers"` SourceDoH bool `toml:"doh_servers"`
SourceODoH bool `toml:"odoh_servers"`
SourceIPv4 bool `toml:"ipv4_servers"` SourceIPv4 bool `toml:"ipv4_servers"`
SourceIPv6 bool `toml:"ipv6_servers"` SourceIPv6 bool `toml:"ipv6_servers"`
MaxClients uint32 `toml:"max_clients"` MaxClients uint32 `toml:"max_clients"`
@ -131,6 +132,7 @@ func newConfig() Config {
SourceIPv6: false, SourceIPv6: false,
SourceDNSCrypt: true, SourceDNSCrypt: true,
SourceDoH: true, SourceDoH: true,
SourceODoH: false,
MaxClients: 250, MaxClients: 250,
BootstrapResolvers: []string{DefaultBootstrapResolver}, BootstrapResolvers: []string{DefaultBootstrapResolver},
IgnoreSystemDNS: false, IgnoreSystemDNS: false,
@ -651,6 +653,7 @@ func ConfigLoad(proxy *Proxy, flags *ConfigFlags) error {
config.SourceIPv6 = true config.SourceIPv6 = true
config.SourceDNSCrypt = true config.SourceDNSCrypt = true
config.SourceDoH = true config.SourceDoH = true
config.SourceODoH = true
} }
var requiredProps stamps.ServerInformalProperties var requiredProps stamps.ServerInformalProperties
@ -670,6 +673,7 @@ func ConfigLoad(proxy *Proxy, flags *ConfigFlags) error {
proxy.SourceIPv6 = config.SourceIPv6 proxy.SourceIPv6 = config.SourceIPv6
proxy.SourceDNSCrypt = config.SourceDNSCrypt proxy.SourceDNSCrypt = config.SourceDNSCrypt
proxy.SourceDoH = config.SourceDoH proxy.SourceDoH = config.SourceDoH
proxy.SourceODoH = config.SourceODoH
netprobeTimeout := config.NetprobeTimeout netprobeTimeout := config.NetprobeTimeout
flag.Visit(func(flag *flag.Flag) { flag.Visit(func(flag *flag.Flag) {

View File

@ -69,6 +69,9 @@ dnscrypt_servers = true
# Use servers implementing the DNS-over-HTTPS protocol # Use servers implementing the DNS-over-HTTPS protocol
doh_servers = true doh_servers = true
# Use servers implementing the Oblivious DoH protocol
odoh_servers = false
## Require servers defined by remote sources to satisfy specific properties ## Require servers defined by remote sources to satisfy specific properties

View File

@ -101,6 +101,7 @@ type Proxy struct {
SourceIPv6 bool SourceIPv6 bool
SourceDNSCrypt bool SourceDNSCrypt bool
SourceDoH bool SourceDoH bool
SourceODoH bool
} }
func (proxy *Proxy) registerUDPListener(conn *net.UDPConn) { func (proxy *Proxy) registerUDPListener(conn *net.UDPConn) {
@ -328,7 +329,8 @@ func (proxy *Proxy) updateRegisteredServers() error {
} }
} else { } else {
if !((proxy.SourceDNSCrypt && registeredServer.stamp.Proto == stamps.StampProtoTypeDNSCrypt) || if !((proxy.SourceDNSCrypt && registeredServer.stamp.Proto == stamps.StampProtoTypeDNSCrypt) ||
(proxy.SourceDoH && registeredServer.stamp.Proto == stamps.StampProtoTypeDoH)) { (proxy.SourceDoH && registeredServer.stamp.Proto == stamps.StampProtoTypeDoH) ||
(proxy.SourceODoH && registeredServer.stamp.Proto == stamps.StampProtoTypeODoHTarget)) {
continue continue
} }
var found bool var found bool