httpclient访问https
在自己的机器做了tomcat单向认证,然后用httpclient4.x访问
CloseableHttpClient client=HttpClientFactory.getCloseableHttpClient()
HttpGet get=new HttpGet("https://localhost:8443/")
// HttpGet get=new HttpGet("https://www.baidu.com")
CloseableHttpResponse response=client.execute(get)
BufferedReader reader=new BufferedReader(new InputStreamReader(response.getEntity().getContent()))
String line=reader.readLine()
while(line!=null){
log.debug(line);
line=reader.readLine()
}
访问自己的tomcat报错,SunCertPathBuilderException occurred when processing request: [GET] /cloudolp.dc/test/https
unable to find valid certification path to requested target。报错也可以理解,因为没有配置证书,但是为什么访问百度不会有问题?我也没有为百度配置证书。而且https是加密的,但我用https访问百度读到的输出流是明文,又是为什么
CloseableHttpClient client=HttpClientFactory.getCloseableHttpClient()
HttpGet get=new HttpGet("https://localhost:8443/")
// HttpGet get=new HttpGet("https://www.baidu.com")
CloseableHttpResponse response=client.execute(get)
BufferedReader reader=new BufferedReader(new InputStreamReader(response.getEntity().getContent()))
String line=reader.readLine()
while(line!=null){
log.debug(line);
line=reader.readLine()
}
访问自己的tomcat报错,SunCertPathBuilderException occurred when processing request: [GET] /cloudolp.dc/test/https
unable to find valid certification path to requested target。报错也可以理解,因为没有配置证书,但是为什么访问百度不会有问题?我也没有为百度配置证书。而且https是加密的,但我用https访问百度读到的输出流是明文,又是为什么
...全文
相关推荐
httpclient来进行https访问
httpclient来进行https访问
HttpClient 使用证书访问https站点
使用HttpClient访问https 站点时,如果JRE或者JDK没有导入某个站点的证书,则会报如下错误: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification
使用httpClient访问https+443端口号。
NULL 博文链接:https://from-null.iteye.com/blog/859795
httpclient4.1访问https的配置方法
利用tomcat搭建支持ssl的服务,并由httpClient进行https访问。整个过程简单明了。 1.生成key. 2.配置tomcat支持ssl 3.利用一个简单例子用httpClient连接ssl
httpclient访问需要客户端认证数字证书的https接口的处理方法
NULL 博文链接:https://liudeh-009.iteye.com/blog/1181571


