当前位置: 代码迷 >> J2SE >> CSDN高手有木有?如何样使用HttpsURLConnection 进行远程请求
  详细解决方案

CSDN高手有木有?如何样使用HttpsURLConnection 进行远程请求

热度:278   发布时间:2016-04-24 02:27:26.0
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
  相关解决方案