0

I try to fetch data from https client. Same code i used to fetch from http client. but its working fine. when i try to use Https client its not working. i am getting the following error.

Error Log:

10-27 10:01:08.280: W/System.err(21826): java.net.UnknownHostException: Host is unresolved: https client address.com 443 
10-27 10:01:08.290: W/System.err(21826): at java.net.Socket.connect(Socket.java:1037) 
10-27 10:01:08.290: W/System.err(21826): at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:317)
10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:129)
10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164)
10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119)
10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348)
10-27 10:01:08.310: W/System.err(21826): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555)
10-27 10:01:08.320: W/System.err(21826): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487)
10-27 10:01:08.320: W/System.err(21826): at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465)
10-27 10:01:08.320: W/System.err(21826): at com.myfile.JSONParser.getJSONFromUrl(JSONParser.java:38) 
10-27 10:01:08.320: W/System.err(21826): at com.myfile.myfile.processThread(myfile.java:159)
10-27 10:01:08.330: W/System.err(21826): at com.peripay.PERIPay$1$1.run(myfile.java:65)
10-27 10:01:08.330: E/Buffer Error(21826): Error converting result java.lang.NullPointerException 
10-27 10:01:08.330: E/JSON Parser(21826): Error parsing data org.json.JSONException: A JSONObject text must begin with '{' at character 0 of
  • It may be your URL not an `https` And, anyway [it maybe helps you](http://stackoverflow.com/q/6385450/940096) – Praveenkumar Oct 27 '12 at 10:28
  • We have two servers one is http and another one is https. I try to use the same code in both servers. It works fine for http server. But it was not working for https server.Please advice me. – Madhan Shanmugam Oct 27 '12 at 17:06
  • check in the following link : https://stackoverflow.com/questions/12642382/generate-listview-from-json-in-android/12740155#12740155 – G M Ramesh Oct 27 '12 at 11:27
  • Same jsonparser code working fine for http server json data. But it was not working for https server json data. My question is whether we can fetch a json data from https server? if it is possible what to do. please explain me in detail. – Madhan Shanmugam Oct 27 '12 at 17:04

0 Answers0