0

我尝试从 https 客户端获取数据。我用来从 http 客户端获取的相同代码。但它工作正常。当我尝试使用 Https 客户端时,它不起作用。我收到以下错误。

错误日志:

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
4

0 回答 0