Tag: world of warcraft

Android上的Apache HttpClient产生CertPathValidatorException(IssuerName!= SubjectName)

我正在开发一个Android应用程序访问一些battle.net( https://eu.battle.net )帐户数据(魔兽世界),我使用org.apache.http.client.HttpClient来这样做。 这是我正在使用的代码: public static final String USER_AGENT = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8 (.NET CLR 3.5.30729)"; public static class MyHttpClient extends DefaultHttpClient { final Context context; public MyHttpClient(Context context) { super(); this.context = context; } @Override protected ClientConnectionManager createClientConnectionManager() { SchemeRegistry registry = new SchemeRegistry(); registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), […]