所以我有一个网页,我想通过HttpsURLConnection访问它。证书是由Digicert CA-3颁发的,但我总是得到400的响应。android开发人员网站,wikipedia example works fine.This网站也会在设备上的chrome上打开。我想知道这是否会是我调用call.or的方式的问题,可能是问题
URL url = new URL(strUrl);
HttpsURLConnection urlConnection = (HttpsURLConnection) url
.openConnection();
SSLContext sslcontext = SSLContext.getDefault();
CookieSyncManager.createInstance(context);
CookieManager cookieManager = CookieManager.getInstance();
cookieManager.removeAllCookie();
urlConnection.setDoOutput(false);
urlConnection.setDoInput(true);
urlConnection.setSSLSocketFactory(sslcontext.getSocketFactory());
int code = urlConnection.getResponseCode(); //always 400 :(发布于 2014-08-07 17:20:27
也许您应该仔细检查您正在使用的URL。这主要是因为客户端的错误请求..
https://stackoverflow.com/questions/25178396
复制相似问题