3
如何在新的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)
現在SSLSocketFactory
標示爲淘汰,創造它。定義TrustStrategy
的新方法是什麼?我無法弄清楚。
究竟是什麼意思這個空值? 「SSLContexts.custom()。loadTrustMaterial(null,...」Regards –
@Zilevav它是帶有密鑰存儲(java.security.KeyStore)的對象的實例。 – expert