我想ping一下一个https的请求,但是用httpclinet请求报错!
HttpClient client = new HttpClient();
client.setConnectionTimeout(10 * 1000);
client.setTimeout(10 * 1000);
//一个HTTPS的地址
PostMethod post = new PostMethod("https://..........."); try {
int status = client.executeMethod(post); if (status != Constants.HTTP_STATUS_OK) {
return SERVICE_CLOSE;
} return SERVICE_OK;
} catch (SocketTimeoutException timeOut) {
timeOut.printStackTrace();
return SERVICE_TIME_OUT;
} catch (Exception e) {
e.printStackTrace();
return SERVICE_CLOSE;
}
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath请问大家https的请求怎么解决啊?这种方法只能请求http的!!
HttpClient client = new HttpClient();
client.setConnectionTimeout(10 * 1000);
client.setTimeout(10 * 1000);
//一个HTTPS的地址
PostMethod post = new PostMethod("https://..........."); try {
int status = client.executeMethod(post); if (status != Constants.HTTP_STATUS_OK) {
return SERVICE_CLOSE;
} return SERVICE_OK;
} catch (SocketTimeoutException timeOut) {
timeOut.printStackTrace();
return SERVICE_TIME_OUT;
} catch (Exception e) {
e.printStackTrace();
return SERVICE_CLOSE;
}
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath请问大家https的请求怎么解决啊?这种方法只能请求http的!!
* 构招一个AuthSSLInitializationError实例
*/
public AuthSSLInitializationError() {
super();
} /**
* 用指定信息构造一个AuthSSLInitializationError实例
* @param message
*/
public AuthSSLInitializationError(String message) {
super(message);
}
}