使用HttpClient调用API时没有对等证书

时间:2018-12-13 10:49:45

标签: android ssl httpclient

Error: No Peer certificate

我仅在签名的APK OS 6及更低版本中遇到SSL证书的问题。目前,我正在使用DefaultHttpClient来实现API。

我使用过的图书馆:

  
      
  • httpclient-4.2.5.jar
  •   
  • httpmime-4.2.1.jar
  •   
  • httpcore-4.2.4.jar
  •   

您可以在下面找到我的代码段:

HttpEntity httpEntity = null;
HttpResponse httpResponse = null;
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
httpGet.setHeader(Header,HeaderValue);
httpResponse = httpClient.execute(httpGet);

0 个答案:

没有答案