Tag: asynchttpclient

使用https的async-http-client的CertificateException

几天前我开始使用async-http-client访问https://ws.plimus.com/时遇到问题。 我得到一个“常规SSLEngine问题”消息,并在堆栈跟踪中我可以看到它是由 java.security.cert.CertificateException: Certificates does not conform to algorithm constraints 这个SO问题描述的基本相同。 在java.security中注释掉该行会使错误消失,但我认为有充分的理由禁用MD2。 使用拉曼的答案提示,我发现async-http-client库确实使用了X509TrustManager接口 ,但我没有做太多改变。 运行这个: openssl s_client -showcerts -connect ws.plimus.com:443 | grep -i md2 什么都没发现,所以我甚至不知道哪个证书导致了这个问题。 除了解决方法之外,我能做些什么吗? 我把演示代码重现了github上的问题。

如何创建异步缓存http客户端?

使用org.apache.httpcomponents:httpasyncclient-cache:4.1.3库,我试图弄清楚如何创建asynchronous caching http客户端? 我可以使用各自的构建器单独创建每个,但我找不到两种方法。 例如 CloseableHttpClient client = CachingHttpClientBuilder.create() .setCacheConfig(cacheConfig()) .build(); CloseableHttpAsyncClient build = HttpAsyncClientBuilder.create() .build(); Por que no los dos? 注意我并不依赖于这个版本的库 – 很高兴使用最新版本的解决方案。 有关: 如何像浏览器一样实现客户端http缓存?

Android – loopJ AsyncHttpClient返回响应onFinish或onSuccess

我正在寻找一种方法来返回我在loopJ AsyncHttpClient onFinish或onSuccess或onFailure中得到的响应。 截至目前,我有这段代码: **jsonParse.java file** public class jsonParse { static JSONObject jObj = null; static String jsonString = “”; AsyncHttpClient client; public JSONObject getJSONObj() { RequestParams params; params = new RequestParams(); params.add(“username”, “user”); params.add(“password”, “password”); client = new AsyncHttpClient(); client.post(“http://example.com”, params, new TextHttpResponseHandler() { @Override public void onSuccess(int i, Header[] headers, String response) { […]