0

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;
            }
  • Possible duplicate of [Android 2.3.x javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found](http://stackoverflow.com/questions/21306336/android-2-3-x-javax-net-ssl-sslhandshakeexception-java-security-cert-certpathva) – Barend Oct 09 '15 at 19:36
  • yeah you may be right , but i am facing same issue on android 5.0 . so i think my question is unique – Saba Mehmood Oct 12 '15 at 13:00

0 Answers0