如何使用Apache HttpClient 4.0 绕过无效的SSL证书错误?
使用HttpClient时,尝试通过HTTPS进行通信时收到以下错误:
线程"main"中的异常javax.net.ssl.SSLPeerUnverifiedException:peer未经过身份验证.
这是我的代码:
URI loginUri = new URI("https://myUrl.asp");
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet( loginUri );
HttpResponse response = httpclient.execute( httpget );
Run Code Online (Sandbox Code Playgroud)
如何抑制或删除此错误?