Package org.asynchttpclient.AsyncHttpClientConfig

Examples of org.asynchttpclient.AsyncHttpClientConfig.Builder


    }

    @Test(groups = { "standalone", "default_provider" })
    public void reconnectsAfterFailedCertificationPath() throws Exception {
        AtomicBoolean trusted = new AtomicBoolean(false);
        AsyncHttpClient c = getAsyncHttpClient(new Builder().setSSLContext(createSSLContext(trusted)).build());
        try {
            String body = "hello there";

            // first request fails because server certificate is rejected
            Throwable cause = null;
View Full Code Here


    @Test(timeOut = 5000)
    public void failInstantlyIfHostNamesDiffer() throws Exception {
        AsyncHttpClient client = null;

        try {
            final Builder builder = new Builder().setHostnameVerifier(new HostnameVerifier() {

                public boolean verify(String arg0, SSLSession arg1) {
                    return false;
                }
            }).setRequestTimeout(20000);

            client = getAsyncHttpClient(builder.build());

            try {
            client.prepareGet("https://github.com/AsyncHttpClient/async-http-client/issues/355").execute().get(TIMEOUT, TimeUnit.SECONDS);
           
            Assert.assertTrue(false, "Shouldn't be here: should get an Exception");
View Full Code Here

TOP

Related Classes of org.asynchttpclient.AsyncHttpClientConfig.Builder

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.