javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException

复制代码
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
	at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302)
	at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1509)
	at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:216)
	at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979)
	at sun.security.ssl.Handshaker.process_record(Handshaker.java:914)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
	at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
	at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
	at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
	at com.bosideng.bsdyun.pos.util.UlucClient.doGet(UlucClient.java:100)
	at com.bosideng.bsdyun.pos.util.UluchttpUtil.getUlucStoresResponse(UluchttpUtil.java:34)
	at com.bosideng.bsdyun.pos.dts.ulucu.GetUlucuCustomerMemberNumToBiJob.download(GetUlucuCustomerMemberNumToBiJob.java:44)
	at com.bosideng.bsdyun.pos.dts.ulucu.GetUlucuMemberNumToBi.process(GetUlucuMemberNumToBi.java:43)
	at com.alibaba.dts.client.executor.simple.processor.SimpleTaskProcessor.executeTask(SimpleTaskProcessor.java:163)
	at com.alibaba.dts.client.executor.simple.processor.SimpleTaskProcessor.run(SimpleTaskProcessor.java:101)
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
	at sun.security.validator.Validator.validate(Validator.java:260)
	at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
	at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:229)
	at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:124)
	at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1491)
	... 25 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:146)
	at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131)
	at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
	... 31 more

调用API接口,返回以上错误。

排查结果:SSL证书进行了更新,本地有缓存,导致严重不通过,清除本地证书缓存可以解决

bash 复制代码
sudo update-ca-certificates
相关推荐
dog2502 小时前
TCP RTO 与丢包检测
网络·网络协议·tcp/ip
希赛网2 小时前
HCIA-Datacom认证笔记:IP路由基础——核心概念与路由分类
网络·笔记·网络协议·tcp/ip·智能路由器
网络研究院3 小时前
从内部保护你的网络
网络·安全·风险·成本·措施
AQin10123 小时前
一篇文章带你记住 OSI 和 TCP/IP 模型
后端·网络协议
zzc9214 小时前
USRP捕获手机/路由器数据传输信号波形(中)
网络·5g·wifi·路由器·双工通信·手机信号
ALLSectorSorft4 小时前
相亲小程序个人资料管理系统模块搭建
服务器·网络·数据库·python·sql
zhyoobo4 小时前
IPv4 与 IPv6:网络世界的世代更替与未来之路
网络·http·ipv4·ipv6
wanhengidc5 小时前
高防服务器租用:保障数据安全
服务器·网络·安全
搬码临时工5 小时前
本地部署VMware ESXi,并实现无公网IP远程访问管理服务器
服务器·网络协议·tcp/ip