最近调用单点登录系统报错如下:
java.lang.RuntimeException: 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
原因是需要把请求地址的证书引入进来,从浏览器里地址栏左边的锁把证书下载下来,然后需要导入到linux的服务器上。 查看证书的命令为:
keytool -list -keystore /usr/local/jdk1.8.0_112/jre/lib/security/cacerts/
导入证书的命令为:
keytool -import -alias LL1 -keystore /usr/local/jdk1.8.0_112/jre/lib/security/cacerts/ -file /usr/local/jdk1.8.0_112/jre/lib/security/hnagroup.cer
重启服务器即可解决掉此异常。