【问题标题】:Apache SSL configuration errorApache SSL 配置错误
【发布时间】:2014-05-27 05:25:36
【问题描述】:

我正在使用 apache apache-httpcomponents-httpcore.jarapache-httpcomponents-httpclient.jar 4.1 版并遵循本教程 here,文章中明确表示它支持 HttpClient

这里:

    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);

在所有这些中,它都说constructoe是未定义的

【问题讨论】:

    标签: java apache ssl


    【解决方案1】:

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

    【讨论】:

    • 所有导入都可以org.apache.http.conn.ssl.SSLSocketFactory
    猜你喜欢
    • 2011-03-18
    • 1970-01-01
    • 2016-04-13
    • 2011-05-06
    • 2015-06-14
    • 2018-02-01
    • 2020-04-24
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多