当我通过HttpClient对象执行相同的URL时,直接在Linux Server或Windows Server中工作,但在tomcat Server中不起作用。
我的代码如下:
try {
HttpPost httppost = new HttpPost(
"https://192.xxx.x.xx:8443/resources/login");
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response = httpclient.execute(httppost);
} catch (Exception e) {
e.printStackTrace();
Log.e("problem", "" + " ," + e.toString());
}
运行此时,然后是Exception Throw
javax.net.ssl.SSLPeerUnverifiedException: No peer certificate
如何解决这个问题。请帮帮我。
答案 0 :(得分:0)
https://
上发生SSLPeerUnverifiedException。使用http://
将删除该异常。但这不是一个好习惯。可能你需要班级SSLSocketFactory
。请参阅Android SSL - No Peer Certificate