我正在使用apache apache-httpcomponents-httpcore.jar和apache-httpcomponents-httpclient.jar版本4.1,并遵循本教程的here,在文章中很清楚它支持HttpClient < 4.3,但我在代码中遇到了一个语法错误。
这里:
1. SSLSocketFactory sf = new SSLSocketFactory(easyStrategy,SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
2. SchemeRegistry registry = new SchemeRegistry();
3. registry.register(new Scheme("https", 8443, sf));
4. ClientConnectionManager ccm = new ThreadSafeClientConnManager(registry);
5. client = new DefaultHttpClient(ccm);在所有这些代码中,它都说构造the是未定义的
发布于 2014-05-27 15:09:42
您可能已经导入了javax.net.ssl.SSLSocketFactory,而不是Apache。
https://stackoverflow.com/questions/23881595
复制相似问题