|
|
|
@ -322,6 +322,9 @@ public class DnsHelper {
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
|
boolean dns_custom = prefs.getBoolean("dns_custom", false);
|
|
|
|
|
|
|
|
|
|
if (!hasDnsSec())
|
|
|
|
|
dnssec = false;
|
|
|
|
|
|
|
|
|
|
if (!dns_custom && !dnssec)
|
|
|
|
|
return InetAddress.getByName(host);
|
|
|
|
|
|
|
|
|
@ -335,6 +338,9 @@ public class DnsHelper {
|
|
|
|
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
|
|
|
|
boolean dns_custom = prefs.getBoolean("dns_custom", false);
|
|
|
|
|
|
|
|
|
|
if (!hasDnsSec())
|
|
|
|
|
dnssec = false;
|
|
|
|
|
|
|
|
|
|
if (!dns_custom && !dnssec)
|
|
|
|
|
return InetAddress.getAllByName(host);
|
|
|
|
|
|
|
|
|
@ -360,6 +366,9 @@ public class DnsHelper {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void verifyDane(X509Certificate[] chain, String server, int port) throws CertificateException {
|
|
|
|
|
if (!hasDnsSec())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
Handler handler = new Handler() {
|
|
|
|
|
@Override
|
|
|
|
|
public void publish(LogRecord record) {
|
|
|
|
@ -452,6 +461,11 @@ public class DnsHelper {
|
|
|
|
|
editor.apply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static boolean hasDnsSec() {
|
|
|
|
|
// DNSSEC causes crashes in libc
|
|
|
|
|
return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void test(Context context) throws UnknownHostException {
|
|
|
|
|
test(context, "gmail.com", "ns");
|
|
|
|
|
test(context, "web.de", "mx");
|
|
|
|
|