不推荐使用 sslcontextbuilder 和 SSLContexts
sslcontextbuilder and SSLContexts deprecated
我正在使用 JDK1.8 和 JDK Compilance JavaSE-1.7、Eclipse Luna 和 Apache httpclient 4.4.1。
我在 Eclipse 中收到警告,指出 sslcontextbuilder
和 SSLContexts
已弃用。这些 类 的替代品是什么?
实际上我一直在看这个,HttpCLient SSLContexts class 似乎正在从 org.apache.http.conn.ssl.SSLContexts 移动到 org.apache.http.ssl.SSLContexts。我将导入更改为这些新包,现在看起来不错。不确定您对 sslcontextbuilder 的参考是什么,但我很确定它也有替代实现。让我知道更多细节,我可以查看。
您可以按照下面的代码更改它
// 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
我正在使用 JDK1.8 和 JDK Compilance JavaSE-1.7、Eclipse Luna 和 Apache httpclient 4.4.1。
我在 Eclipse 中收到警告,指出 sslcontextbuilder
和 SSLContexts
已弃用。这些 类 的替代品是什么?
实际上我一直在看这个,HttpCLient SSLContexts class 似乎正在从 org.apache.http.conn.ssl.SSLContexts 移动到 org.apache.http.ssl.SSLContexts。我将导入更改为这些新包,现在看起来不错。不确定您对 sslcontextbuilder 的参考是什么,但我很确定它也有替代实现。让我知道更多细节,我可以查看。
您可以按照下面的代码更改它
// 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