I am trying to load https://www.paytm.com and search some products in webview but facing following problems in it. 1.It is not loading images in home page 2.If I search any products in search box window is getting stuck and not giving any results 3.if I click any product link, in status bar it showing as finished but nothing is displayed/rendered in page
private void Pageload() {
// Create a trust manager that does not validate certificate chains
TrustManager[] trustAllCerts = new TrustManager[] {
new X509TrustManager() {
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
public void checkServerTrusted(
java.security.cert.X509Certificate[] certs, String authType) {
}
}
};
// Install the all-trusting trust manager
try {
SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, trustAllCerts, new java.security.SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
} catch (Exception e) {
System.out.println(e);
}
//now you can load the content:
String url = makeUrl(textField.getText()) ;
webView.getEngine().load(url);
textField.setText(url);
}
All other sites are working fine including google,gmail. I am aware that the way I am creating trust manager to trust all is not a good practice, this is only for testing so I am doing it.