javax.net.ssl.SSLHandshakeException:cert.CertPathValidatorException:找不到证书路径的信任锚-Cordova for Android中的错误 [英] javax.net.ssl.SSLHandshakeException:cert.CertPathValidatorException:Trust anchor for certification path not found -error in Cordova for Android

查看:284
本文介绍了javax.net.ssl.SSLHandshakeException:cert.CertPathValidatorException:找不到证书路径的信任锚-Cordova for Android中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have integrated Cordova-plugin-client-certificate-addictic in a Cordova app. It’s working great in iPhone but when I run app on Android it’s not working. Error message I am getting in Android is: java.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException:Trust anchor for certification path not found.

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

Should I need to do some additional stuff for Android, I searched on stack overflow and on github nothing worked so far. Please suggest.

推荐答案

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

After trying various solutions from various post, it did not work. Then i was start doing hit and trial method and one of them worked, below is the detail for same:

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

open project in android studio and Open the ClientCertificate.java from src folder of plugin.

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

step 1:go to line#60 and comment this line // InputStream astream = new FileInputStream(initialFile); and put this new line: InputStream astream = cordova.getActivity().getApplicationContext().getAssets().open(p12path);

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

step2: go to line# // p12path = a.getString(0); and put this new line# p12path = "www/" + a.getString(0);

这篇关于javax.net.ssl.SSLHandshakeException:cert.CertPathValidatorException:找不到证书路径的信任锚-Cordova for Android中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆