Advertisement
Guest User

Untitled

a guest
Jul 26th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
  2. at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:397)
  3. at org.apache.http.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:128)
  4. at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:390)
  5. at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
  6. at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
  7.  
  8. HttpClient client = new DefaultHttpClient();
  9.  
  10. HttpPost post = new HttpPost(
  11. "https://mife.smobile.lk/apicall/dialogloanprepaid/v1.0/auto");
  12.  
  13. JSONObject json = new JSONObject();
  14. StringEntity params = new StringEntity("{"msisdn":"" + mobile
  15. + "","channel":"IVR"}");
  16.  
  17. new StringEntity(json.toString());
  18. post.addHeader("content-type", "application/json");
  19. post.addHeader("Authorization", "Bearer " + access_token);
  20. post.addHeader("Accept", "application/json");
  21.  
  22. post.setEntity(params);
  23. HttpResponse response = client.execute(post);
  24. int status = response.getStatusLine().getStatusCode();
  25. System.out.println("status code is :" + status);
  26. resCode = Integer.toString(status);
  27.  
  28. BufferedReader rd = new BufferedReader(new InputStreamReader(
  29. response.getEntity().getContent()));
  30. String response1 = readAll(rd);
  31. System.out.println(response1);
  32. JSONObject obj = new JSONObject(response1);
  33. resCode = obj.getString("resCode");
  34. resDesc = obj.getString("resDesc");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement