我最近在努力解决问题 .

我必须使用SPRING restTemplate对安全的后端进行HTTP调用!

它适用于http endpoints ,但对于https,它会给我以下错误:

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; nested exception is 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

在将证书导入到JDK的jre / security中的cacerts之前,我已经解决了这个问题 .

我最好找到一种方法,不为我部署.war的每台机器做这件事 .

有线索吗?

提前致谢