1

使用以下 http 请求代码使用 google places api 获取对等证书错误:->(我认为在使用 google places api http 请求时不需要添加 SSLSocketFactory 等)谁能告诉我如何解决这个问题?

   public JSONObject showPorts() 
         throws ClientProtocolException, IOException, JSONException{

            // StringBuilder portURL = new StringBuilder(pURL);        
            // HttpGet get = new HttpGet(url);
     StringBuilder portURL = new StringBuilder(pURL);        
        HttpGet get = new HttpGet(portURL.toString());
             Log.d(TAG,pURL);                        

             HttpResponse r = client.execute(get);
             int status = r.getStatusLine().getStatusCode();

             if(status == 200){
                 Log.d(TAG,"200");                       

             HttpEntity e = r.getEntity();
             String data = EntityUtils.toString(e);
4

0 回答 0