Package com.sun.jini.test.spec.jeri.ssltrustverifier.util

Examples of com.sun.jini.test.spec.jeri.ssltrustverifier.util.TestSocketFactory


        //Verify that instances of KerberosEndpoint
        //with trusted socket factories are trusted.
        endpoint = KerberosEndpoint.getInstance(
            InetAddress.getLocalHost().getHostAddress(), port,
            new KerberosPrincipal("test@test"),
            new TestSocketFactory(true));
        if (!verifier.isTrustedObject(endpoint,ctx)){
            throw new TestException("KerberosEndpoint instance"
                + " with trusted factory is considered untrusted");
        }
        //Verify that instances of KerberosEndpoint with
        //untrusted socket factories are not trusted.
        endpoint = KerberosEndpoint.getInstance(
            InetAddress.getLocalHost().getHostAddress(), port,
            new KerberosPrincipal("test@test"),
            new TestSocketFactory(false));
        if (verifier.isTrustedObject(endpoint,ctx)){
            throw new TestException("KerberosEndpoint instance"
                + " with untrusted factory is considered trusted");
        }
        //Verify that instances of KerberosPrincipal are trusted.
View Full Code Here


        }
        //Verify that instances of HttpsEndpoint and SslEndpoint
        //with trusted socket factories are trusted.
        httpsEndpoint = HttpsEndpoint.getInstance(
            InetAddress.getLocalHost().getHostAddress(), port,
            new TestSocketFactory(true));
        sslEndpoint = SslEndpoint.getInstance(
            InetAddress.getLocalHost().getHostAddress(), port,
            new TestSocketFactory(true));
        if (!verifier.isTrustedObject(httpsEndpoint,ctx)){
            throw new TestException("HttpsEndpoint instance"
                + " with trusted socket factory is considered untrusted");
        }
        if (!verifier.isTrustedObject(sslEndpoint,ctx)){
            throw new TestException("SslEndpoint instance"
                + " with trusted factory is considered untrusted");
        }
        //Verify that instances of HttpsEndpoint and SslEndpoint with
        //untrusted socket factories are not trusted.
        httpsEndpoint = HttpsEndpoint.getInstance(
            InetAddress.getLocalHost().getHostAddress(), port,
            new TestSocketFactory(false));
        sslEndpoint = SslEndpoint.getInstance(
            InetAddress.getLocalHost().getHostAddress(), port,
            new TestSocketFactory(false));
        if (verifier.isTrustedObject(httpsEndpoint,ctx)){
            throw new TestException("HttpsEndpoint instance"
                + " with untrusted socket factory is considered trusted");
        }
        if (verifier.isTrustedObject(sslEndpoint,ctx)){
View Full Code Here

TOP

Related Classes of com.sun.jini.test.spec.jeri.ssltrustverifier.util.TestSocketFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.