Search in sources :

Example 1 with DnssecResultNotAuthenticException

use of org.minidns.dnssec.DnssecResultNotAuthenticException in project Smack by igniterealtime.

the class MiniDnsResolver method shouldAbortIfNotAuthentic.

private static boolean shouldAbortIfNotAuthentic(DnsName name, DnssecMode dnssecMode, ResolverResult<?> result, List<RemoteConnectionEndpointLookupFailure> lookupFailures) {
    switch(dnssecMode) {
        case needsDnssec:
        case needsDnssecAndDane:
            // Check if the result is authentic data, i.e. there a no reasons the result is unverified.
            DnssecResultNotAuthenticException exception = result.getDnssecResultNotAuthenticException();
            if (exception != null) {
                RemoteConnectionEndpointLookupFailure failure = new RemoteConnectionEndpointLookupFailure.DnsLookupFailure(name, exception);
                lookupFailures.add(failure);
                return true;
            }
            break;
        case disabled:
            break;
        default:
            throw new IllegalStateException("Unknown DnssecMode: " + dnssecMode);
    }
    return false;
}
Also used : DnssecResultNotAuthenticException(org.minidns.dnssec.DnssecResultNotAuthenticException) RemoteConnectionEndpointLookupFailure(org.jivesoftware.smack.util.rce.RemoteConnectionEndpointLookupFailure)

Aggregations

RemoteConnectionEndpointLookupFailure (org.jivesoftware.smack.util.rce.RemoteConnectionEndpointLookupFailure)1 DnssecResultNotAuthenticException (org.minidns.dnssec.DnssecResultNotAuthenticException)1