更新时间:2022-02-02 03:03:52
解决方案是将该证书添加到java cacerts文件中,以便使其永久被接受.
Solution is to add that certificate to java cacerts file so that it got permanently accepted.
第1步:获取 https://www.wikipedia.org 的根证书(或您提供的任何网址)要访问)
Step 1 : Get root certificate of https://www.wikipedia.org (or any url you want to access)
就是这样!您已经获得了根证书!
Thats it! you got your root certificate!
第2步:将该证书添加到java cacerts文件中.
Step 2 : Get that certificate added to java cacerts file.
keytool –导入–noprompt –trustcacerts –alias ALIASNAME-文件/PATH/TO/您的/DESKTOP/CertificateName.cer -keystore/PATH/TO/YOUR/JDK/jre/lib/security/cacerts -storepass changeit
keytool –import –noprompt –trustcacerts –alias ALIASNAME -file /PATH/TO/YOUR/DESKTOP/CertificateName.cer -keystore /PATH/TO/YOUR/JDK/jre/lib/security/cacerts -storepass changeit
就是这样!您的问题得到解决.
That is it! you got your problem resolved.
请注意
请确认正在执行步骤2的jre发生了此PKIX错误(KAFKA使用的JRE).如果尝试其他jre问题,则保持原样.
Do confirm that the jre which is giving you this PKIX error(JRE used by KAFKA) that is where you are performing STEP 2. If you would try with another jre problem would be as it is.
请仅在JDK内部使用一个jre,这样可以减少出现问题的机会.
Do use only one jre which is inside JDK it decreases chance to have issues.