开发者

Android and SSL - checking certificate validity

I've got the following code making SSL work with my HttpClient connections and such

SchemeRegistry schemeRegistry = new SchemeRegistry();
schemeRegistry.register(new Scheme("https", 
            SSLSocketFactory.getSocketFactory(), 443));

HttpParams params = new BasicHttpParams();

SingleClientConnManager mgr = new SingleClientConnManager(params, schemeRegistry);

HttpClient client = new DefaultHttpClient(mgr, params);

However, does this actually validate the cert? It seems like 开发者_开发技巧there should be more to it.


Nevermind, the above code does indeed validate the certificate. I tried it with some random self signed certs for different sites, and it failed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜