0

Why it works not at all devices? Works at 90% off devices in my app, most of this 10% is Xiaomi, and old Android 4.2 devices.

Catch in try says: No peer certificate

DefaultHttpClient httpclient = new DefaultHttpClient();
            HttpPost httppost = new HttpPost(se());

            try {
                // Add your data
                List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
                nameValuePairs.add(new BasicNameValuePair("phone", phone));
                nameValuePairs.add(new BasicNameValuePair("password", password));
                nameValuePairs.add(new BasicNameValuePair("url", URL));
                httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

                // Execute HTTP Post Request
                HttpResponse response = httpclient.execute(httppost);
                HttpEntity entity = response.getEntity();
                String responseString = EntityUtils.toString(entity, "UTF-8");
                return responseString;
            } catch (ClientProtocolException e) {
                // TODO Auto-generated catch block
                android.util.Log.e("ERROR", e.getMessage());
            } catch (IOException e) {
                // TODO Auto-generated catch block
                android.util.Log.e("ERROR", e.getMessage());
            }
  • Possible duplicate of [Problems with https (No peer certificate) in android](https://stackoverflow.com/questions/9531710/problems-with-https-no-peer-certificate-in-android) – Aditya Feb 14 '18 at 16:20
  • 1
    Sounds like a certificate problem with that device. – Gabe Sechan Feb 14 '18 at 16:21

0 Answers0