Simple codes
public class Demo {
public static void main(String[] args) {
HttpClient httpclient = new DefaultHttpClient();
try {
HttpGet httpget = new HttpGet("https://banweb.cityu.edu.hk/");
HttpResponse response = httpclient.execute(httpget);
} catch (Exception e) {
e.printStackTrace();
}
}
}
I have 2 desktops (A and B), 2 laptops (A and B), 3 android devices (A, B and C) and 3 android emulators (SDK v2.1, v4.0 and v4.03). When above code is run in desktop A, android emulator v4.0 and v4.0.3, it throws "javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated". But the code works fine in other devices and emulators.
Can anyone tell me why the same code shows different results in different machines?
Your help is appreciated.