相关疑难解决方法(0)

如何在新的Apache Http Client 4.3中创建SSL套接字工厂?

如何在新的Apache Http Client 4.3中创建SSL套接字工厂?

这是我在4.3之前创建它的方式

val ts = new TrustStrategy() {
  def isTrusted(chain: Array[X509Certificate], authType: String): Boolean = true
}

new SSLSocketFactory(ts, SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER)
Run Code Online (Sandbox Code Playgroud)

现在SSLSocketFactory标记为已弃用.定义自定义的新方法是TrustStrategy什么?我无法理解.

ssl apache-commons-httpclient

3
推荐指数
1
解决办法
5924
查看次数

标签 统计

apache-commons-httpclient ×1

ssl ×1