【问题标题】:sslcontextbuilder and SSLContexts deprecatedsslcontextbuilder 和 SSLContexts 已弃用
【发布时间】:2015-06-28 08:51:18
【问题描述】:

我将 JDK1.8 与 JDK Compilance JavaSE-1.7、Eclipse Luna 和 Apache httpclient 4.4.1 一起使用。

我在 Eclipse 中收到警告,sslcontextbuilder 和 SSLContexts 已被弃用。这些课程有哪些替代品?

【问题讨论】:

  • 你在使用 OpenJDK 吗?
  • 您能提供更多信息吗?你用的是哪个eclipse,哪个JDK,哪个库?
  • 我正在使用 JDK1.8 和 JDK Compilance JavaSE-1.7、Eclipse Luna 和 Apache httpclient 4.4.1 版本。

标签: java apache ssl


【解决方案1】:

我实际上一直在看这个,看起来 HttpCLient SSLContexts 类正在从 org.apache.http.conn.ssl.SSLContexts 移动到 org.apache.http.ssl.SSLContexts 的过程中。我将导入更改为这些新软件包,现在看起来不错。不确定您对 sslcontextbuilder 的参考是什么,但我很确定它也有替代实现。让我知道更多细节,我可以检查。

【讨论】:

    【解决方案2】:

    你可以改成下面的代码

    // Fixing deprecated code to use current HttpClient implementations      Sekito.Lv 01/30/2019 11:29     Start
    import org.apache.http.ssl.SSLContexts;
    import org.apache.http.ssl.SSLContextBuilder;
    
    //import org.apache.http.conn.ssl.SSLContexts;
    //import org.apache.http.conn.ssl.SSLContextBuilder;
    // Fixing deprecated code to use current HttpClient implementations      Sekito.Lv 01/30/2019 11:29     End
    

    【讨论】:

      猜你喜欢
      • 2012-03-01
      • 2014-02-12
      • 2023-02-19
      • 1970-01-01
      • 2017-04-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-23
      • 1970-01-01
      相关资源
      最近更新 更多