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
相关推荐
一勺菠萝丶6 小时前
「您的连接不是私密连接」详解:为什么 HTTPS 证书会报错,以及如何正确配置子域名证书
数据库·网络协议·https
夕泠爱吃糖6 小时前
HTTPS与HTPP的区别
网络协议·http·https
2501_915909066 小时前
“绑定 HTTPS” 的工程全流程 从证书配置到真机验证与故障排查
网络协议·http·ios·小程序·https·uni-app·iphone
报错小能手6 小时前
linux学习笔记(43)网络编程——HTTPS (补充)
linux·网络·学习
A Runner for leave7 小时前
网络与通信安全课程复习汇总3——身份认证
网络·密码学
EasyGBS9 小时前
EasyGBS如何通过流媒体技术提升安防监控效率?
网络·音视频
岛屿旅人9 小时前
智库报告美国如何打网络战
网络·人工智能·安全·web安全
listhi52012 小时前
TCP 和 UDP 协议的通信解析
网络协议·tcp/ip·udp
扁豆的主人12 小时前
http 状态码
网络·网络协议·http
网安INF13 小时前
网络攻防技术:拒绝服务攻击
网络·安全·web安全·网络安全