I'm getting a "javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found." exception on my Android app. Here is my code
int checkApp(Item item){
int flag=1;
HttpClient httpclient = DefaultClient();
if(item.proxy.length()>0){
HttpHost httpproxy = new HttpHost(item.proxy,Integer.parseInt(item.port));
httpclient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, httpproxy);
}
HttpResponse response;
String responseString = null;
try {
String url="https://play.google.com/store/apps/details?id="+item.pakageName;
response = httpclient.execute(new HttpPost(url));
StatusLine statusLine = response.getStatusLine();
if(statusLine.getStatusCode() == HttpStatus.SC_OK){
flag=1;
} else{
flag=0;
}
} catch (ClientProtocolException e) {
//TODO Handle problems..
logger.Log(e.toString());
flag=0;
} catch (IOException e) {
logger.Log(e.toString());
flag=0;//TODO Handle problems..
}
catch(Exception e){
logger.Log(e.toString());
flag=0;
}
return flag;
}