Apache SSL配置错误

时间:2014-05-27 05:25:36

标签: java apache ssl

我正在使用apache apache-httpcomponents-httpcore.jarapache-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);

在所有这些中它表示构造函数未定义

1 个答案:

答案 0 :(得分:0)

您可能导入了javax.net.ssl.SSLSocketFactory而不是Apache。