更新时间:2022-02-26 22:27:37
当我使用了 TrustSelfSignedStrategy 对象作为信任材料 HttpClient 。
Problem was solved when I used a TrustSelfSignedStrategy object as the Trust material to HttpClient.
httpClient = HttpClients.custom()
.setSSLSocketFactory(new SSLConnectionSocketFactory(SSLContexts.custom()
.loadTrustMaterial(null, new TrustSelfSignedStrategy())
.build()
)
).build();
我使用的代码如上所示..
The code I used is shown above..