且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Smack:“找不到认证路径的信任锚”

更新时间:2022-11-05 22:07:53

KeystorePath应该指向一个Keystore,而不是一个简单的证书。 Android默认情况下使用KeystoreType BKS,因此您应该创建一个并将证书导入其中,如 http://blog.antoine.li/2010/10/22/android-trusting-ssl-certificates/

The KeystorePath should point to a Keystore, not a simple certificate. Android uses KeystoreType BKS by default, so you should create one and import your certificate into it as described by http://blog.antoine.li/2010/10/22/android-trusting-ssl-certificates/

keytool -importcert -v -trustcacerts -file "path_to_cert/interm_ca.cer" -alias IntermediateCA -keystore "res/raw/myKeystore.bks" -provider org.bouncycastle.jce.provider.BouncyCastleProvider -providerpath "path_to_bouncycastle/bcprov-jdk16-145.jar" -storetype BKS -storepass mysecret

你可以如果你不想要的话,也可以使用Portecle( http://portecle.sourceforge.net/ )乱用命令行。

You can also do this using Portecle (http://portecle.sourceforge.net/), if you don't want to mess with the command line.