我有一个应用程序连接到使用Entrust有效证书的Web服务。唯一的区别是它是通配符SSL。https连接Android
的问题是:我得到一个
ERROR/NoHttpResponseException(5195): org.apache.http.NoHttpResponseException: The target server failed to respond
当我在3G上。当在WIFI上它工作,在模拟器上工作,通过我的手机3G工作模拟器。但是3G手机上的应用根本无法工作。在两个不同的网络(Virgin Mobile Canada和Fido)上测试HTC Legend CM7.0.3(2.3.3)和Nexus S 2.3.3。
我有一个PCAP转储从我的设备显示一些错误,但我不明白它真的很好。
确认号码:断开的TCP。确认字段为非零而ACK标志未设置
我也尝试了此question此question的修复。我不知道要去哪里。
顺便说一句,网络服务与3G上的浏览器一起工作。
我们也使用基本身份验证与HttpRequestInterceptor。
我想这是我能给的所有细节。如果需要其他东西,请随时询问。
这个question也有关系,我已经尝试了两个修复,都没有工作。
编辑
我开始认为这可能是更适合serverfault.com
这是转储file和截图
编辑2
这是我用来连接到有问题的Web服务的代码。
protected HttpEntity sendData(List<NameValuePair> pairs, String method)
throws ClientProtocolException, IOException,
AuthenticationException {
pairs.add(new BasicNameValuePair(KEY_SECURITY, KEY));
pairs.add(new BasicNameValuePair(LANG_KEY, lang));
pairs.add(new BasicNameValuePair(OS_KEY, OS));
pairs.add(new BasicNameValuePair(MODEL_KEY, model));
pairs.add(new BasicNameValuePair(CARRIER_KEY, carrier));
DefaultHttpClient client = getClient();
HttpPost post = new HttpPost();
try {
post.setHeader("Content-Type", "application/x-www-form-urlencoded");
post.setEntity(new UrlEncodedFormEntity(pairs));
} catch (UnsupportedEncodingException e1) {
Log.e("UnsupportedEncodingException", e1.toString());
}
URI uri = URI.create(method);
post.setURI(uri);
client.addRequestInterceptor(preemptiveAuth, 0);
HttpHost target = new HttpHost(host, port, protocol);
HttpContext httpContext = new BasicHttpContext();
HttpResponse response = client.execute(target, post, httpContext);
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode == 401) {
throw new AuthenticationException("Invalid username or password");
}
return response.getEntity();
}
您可以添加一些相关的代码,也许可以帮助。 – 2011-06-09 20:26:21
@Nicklas A,添加了一些代码。如果需要某些具体的东西,请问。 – 2011-06-09 20:43:40