javax.net.ssl.SSLHandshakeException:cert.CertPathValidatorException:未找到证书路径的信任锚-Cordova for Android中的错误

时间:2018-06-28 18:53:21

标签: android iphone cordova cordova-plugins

我在Cordova应用程序中集成了Cordova-plugin-client-certificate-addictic。它在iPhone上运行良好,但是当我在Android上运行应用程序时,则无法运行。 我在Android中收到的错误消息是: java.net.ssl.SSLHandshakeException:java.security.cert.CertPathValidatorException:找不到证书路径的信任锚。

我是否需要为Android做一些其他工作,我在堆栈溢出和github上进行了搜索,到目前为止没有任何效果。请提出建议。

1 个答案:

答案 0 :(得分:0)

尝试了各种帖子中的各种解决方案后,它不起作用。 然后,我开始使用命中和试用方法,其中一种有效,下面是相同的详细信息:

在android studio中打开项目,然后从插件的src文件夹中打开ClientCertificate.java。

步骤1:转到第60行,并对这一行添加注释// InputStream astream = new FileInputStream(initialFile); 并输入以下新行:InputStream astream = cordova.getActivity()。getApplicationContext()。getAssets()。open(p12path);

第2步:转到第#行// // p12path = a.getString(0); 并把新行#p12path =“ www /” + a.getString(0);