0

When i execute same URL via HttpClient object then directly works in Linux Server or Windows Server but not works in tomcat Server.

My codes are given below :

try {
 HttpPost httppost = new HttpPost(
                    "https://192.xxx.x.xx:8443/resources/login");
        HttpClient httpclient = new DefaultHttpClient();
        HttpResponse response = httpclient.execute(httppost);
    } catch (Exception e) {
            e.printStackTrace();
            Log.e("problem", "" + " ," + e.toString());

        }

When run this, then Exception Throw

javax.net.ssl.SSLPeerUnverifiedException: No peer certificate

How to solve this. Please help me.

1 Answers1

0

SSLPeerUnverifiedException occures on https://. Using http:// will remove that exception. But it is not a good practice. Probably you need the class SSLSocketFactory. Refer to Android SSL - No Peer Certificate

Community
  • 1
  • 1
Nizam
  • 5,698
  • 9
  • 45
  • 57