关于androidAsyncHttp支持https

一、AsyncHttpClient asycnHttpClient = new AsyncHttpClient(true, 80, 443);

二、或者参照源码,添加证书验证

    You need import the public server certificate into your default keystore, or if you are not interested in the authentication of your client you can initialize the AsyncHttpClient with

 AsyncHttpClient asycnHttpClient = new AsyncHttpClient(true, 80, 443);

   but this trick is not secure because use a custom SSLSocketFactory implementation whos omit the SSL certificate validation, take a look at the AsyncHttpClient source code.


https://github.com/loopj/android-async-http/blob/master/library/src/main/java/com/loopj/android/http/MySSLSocketFactory.java

https://github.com/loopj/android-async-http/blob/master/library/src/main/java/com/loopj/android/http/AsyncHttpClient.java

这里记录一下解决方案,还没验证!!!
posted on 2016-01-12 09:11  shuijilove  阅读(1926)  评论(0编辑  收藏  举报