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
相关推荐
独行soc17 分钟前
2025年渗透测试面试题总结-264(题目+回答)
网络·python·安全·web安全·网络安全·渗透测试·安全狮
jinxinyuuuus1 小时前
GTA 风格 AI 生成器:跨IP融合中的“视觉语义冲突”与风格适配损失
人工智能·网络协议
REDcker1 小时前
tcpdump 网络数据包分析工具完整教程
网络·测试工具·tcpdump
若汝棋茗2 小时前
在网络密林中传递轻盈信使 —— TouchSocket 的 UdpSession 探秘
网络
嵌入式-小王2 小时前
每天掌握一个网络协议----ICMP
网络·网络协议·ping
麦麦鸡腿堡2 小时前
Java_网络编程_InetAddress类与Socket类
java·服务器·网络
Awkwardx2 小时前
Linux网络编程—应用层协议HTTP
网络·网络协议·http
4***v2143 小时前
详解 为什么 tcp 会出现 粘包 拆包 问题
网络·tcp/ip·php
老前端的功夫3 小时前
前端浏览器缓存深度解析:从网络请求到极致性能优化
前端·javascript·网络·缓存·性能优化
Running_slave4 小时前
你应该了解的TCP滑窗
前端·网络协议·tcp/ip