读书人

CSDN高手有木有?如何样使用HttpsURLC

发布时间: 2012-01-20 18:53:53 作者: rapoo

CSDN高手有木有?怎么样使用HttpsURLConnection 进行远程请求?
我用 X509TrustManager 接口实现,但问题是怎么样加载我的证书?

KeyStore ks = KeyStore.getInstance("JKS");
ks.load(new FileInputStream("trustedCerts"),"passphrase".toCharArray());

TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509", "SunJSSE");
tmf.init(ks);

找不到 trustedCerts 路径,这个应该是什么路径,还有 passphrase 这个是什么密码?



[解决办法]
看这个帖子。
http://topic.csdn.net/u/20110518/00/24fe6dfe-e793-499c-b4ed-ad820b51d887.html

读书人网 >J2SE开发

热点推荐