jdk添加三方证书,解决sun.security.validator.ValidatorException: PKIX path building failed

Posted 努力lshdnks

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jdk添加三方证书,解决sun.security.validator.ValidatorException: PKIX path building failed相关的知识,希望对你有一定的参考价值。

mac电脑查找java默认安装目录,一般都在:

/Library/Java/JavaVirtualMachines 下找,用网上命令查找jdk目录真的坑,你一般会得到

/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home

我的目录为:/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/security/cacerts

查看本机电脑jdk已信任证书列表命令:

keytool -list -keystore "/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/security/cacerts" -storepass changeit

添加自定义证书命令:

sudo keytool -importcert -file /Users/xxx/product/crcc.cer -alias crcc -keystore "/Library/Java/JavaVirtualMachines/jdk1.8.0_201.jdk/Contents/Home/jre/lib/security/cacerts" -storepass changeit

必须sudo

-file 证书全路径

其余替换引号里路径

然后输入y同意即可

以上是关于jdk添加三方证书,解决sun.security.validator.ValidatorException: PKIX path building failed的主要内容,如果未能解决你的问题,请参考以下文章

jdk添加三方证书,解决sun.security.validator.ValidatorException: PKIX path building failed

JDK 解决证书不受信异常

jdk信任证书

使用Maven时出现“jssecacerts PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilde”错

java 如何导入https证书 到 Java\jdk1.5.0\jre\lib\security\jssecacerts文件中

异常解决:sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.cer