@Test
    public void testNegativeAcceptAllSSLSocketFactory() throws Exception{

        // test exception is thrown connecting to a random SSL endpoint without explicitly setting factory to allow all

        String name = "GetPostSecureTest." + testName.getMethodName();

        // don't set any interesting properties -- really we're just setting the defaults

        RestClient rc = (RestClient) ClientFactory.getNamedClient(name);

        TEST_SERVER.accept();

        URI getUri = new URI(TEST_SERVICE_URI + "test/");
        HttpRequest request = HttpRequest.newBuilder().uri(getUri).queryParams("name", "test").build();

        boolean foundCause = false;

        try {
            rc.execute(request);
        } catch(Throwable t){
            while (t != null && ! foundCause){
                if (t instanceof SSLPeerUnverifiedException && t.getMessage().startsWith("peer not authenticated")){
                    foundCause = true;
                    break;
                }
                t = t.getCause();
            }
        }

        assertTrue(foundCause);
    }
Test that the AcceptAllSocketFactory works against a dumbed down TLS server, except when it shouldn't...

@author jzarfoss
ribbon-httpclient/src/test/java/com/netflix/niws/client/http/SecureAcceptAllGetTest.java