我有一個應用程序連接到使用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