我在用
HttpClient 4.0
从远程主机获取一些XML。当我使用诸如
https://user:pwd@www.somesite.com
它在浏览器中工作正常,但在具有此stacktrace的httpclient中失败(如下所示)。有什么建议吗?我在用
SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER
同时设置
ThreadSafeClientConnManager
处理HTTPS请求
代码(部分):
final HttpGet get= new HttpGet(url);
final HttpResponse response = this.client.execute(get);
return new BasicResponseHandler().handleResponse(response);
堆栈跟踪:
01-05 22:34:03.783: ERROR/SearchResults(11565):
Failed to process request to URL:
https://user:pwd@www.somesite.com/products/foo/meta/xml_proper_encoding.jsp?version=1
01-05 22:34:03.783: ERROR/SearchResults(11565):
org.apache.http.client.HttpResponseException: Unauthorized