001/*
002 * Copyright 2015-2020 the original author or authors
003 *
004 * This software is licensed under the Apache License, Version 2.0,
005 * the GNU Lesser General Public License version 2 or later ("LGPL")
006 * and the WTFPL.
007 * You may choose either license to govern your use of this software only
008 * upon the condition that you accept all of the terms of either
009 * the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
010 */
011package org.minidns.integrationtest;
012
013import org.minidns.dane.DaneVerifier;
014
015import javax.net.ssl.HttpsURLConnection;
016
017import org.junit.Ignore;
018
019import java.io.IOException;
020import java.net.URL;
021import java.security.cert.CertificateException;
022
023public class DaneTest {
024
025    @Ignore
026    @IntegrationTest
027    public static void testOarcDaneGood() throws IOException, CertificateException {
028        DaneVerifier daneVerifier = new DaneVerifier();
029        daneVerifier.verifiedConnect((HttpsURLConnection) new URL("https://good.dane.dns-oarc.net/").openConnection());
030    }
031
032    @Ignore
033    @IntegrationTest()
034    public static void testOarcDaneBadHash() throws IOException, CertificateException {
035        DaneVerifier daneVerifier = new DaneVerifier();
036        daneVerifier.verifiedConnect((HttpsURLConnection) new URL("https://bad-hash.dane.dns-oarc.net/").openConnection());
037    }
038
039    @Ignore
040    @IntegrationTest
041    public static void testOarcDaneBadParams() throws IOException, CertificateException {
042        DaneVerifier daneVerifier = new DaneVerifier();
043        daneVerifier.verifiedConnect((HttpsURLConnection) new URL("https://bad-params.dane.dns-oarc.net/").openConnection());
044    }
045}