@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");