diff --git a/qutebrowser/browser/network/proxy.py b/qutebrowser/browser/network/proxy.py index a76a65b56..e7d49f148 100644 --- a/qutebrowser/browser/network/proxy.py +++ b/qutebrowser/browser/network/proxy.py @@ -20,7 +20,7 @@ """Handling of proxies.""" -from PyQt5.QtNetwork import QNetworkProxyFactory +from PyQt5.QtNetwork import QNetworkProxy, QNetworkProxyFactory from qutebrowser.config import config, configtypes @@ -45,6 +45,15 @@ class ProxyFactory(QNetworkProxyFactory): """ proxy = config.get('network', 'proxy') if proxy is configtypes.SYSTEM_PROXY: - return QNetworkProxyFactory.systemProxyForQuery(query) + proxies = QNetworkProxyFactory.systemProxyForQuery(query) else: - return [proxy] + proxies = [proxy] + for p in proxies: + if p.type() != QNetworkProxy.NoProxy: + capabilities = p.capabilities() + if config.get('network', 'proxy-dns-requests'): + capabilities |= QNetworkProxy.HostNameLookupCapability + else: + capabilities &= ~QNetworkProxy.HostNameLookupCapability + p.setCapabilities(capabilities) + return proxies diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index aba5694d4..8dd8de302 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -253,6 +253,10 @@ DATA = collections.OrderedDict([ "In addition to the listed values, you can use a `socks://...` or " "`http://...` URL."), + ('proxy-dns-requests', + SettingValue(typ.Bool(), 'true'), + "Whether to send DNS requests over the configured proxy."), + ('ssl-strict', SettingValue(typ.BoolAsk(), 'ask'), "Whether to validate SSL handshakes."),