且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

找不到 Android SSL 连接的信任锚

更新时间:2021-09-07 21:48:24

@Chrispix 的解决方案很危险!信任所有证书允许任何人进行中间人攻击!只需将任何证书发送给客户端,它就会接受它!

The solution of @Chrispix is dangerous! Trusting all certificates allows anybody to do a man in the middle attack! Just send ANY certificate to the client and it will accept it!

将您的证书添加到自定义信任管理器,如本文所述:通过 HTTPS 使用 HttpClient 信任所有证书

Add your certificate(s) to a custom trust manager like described in this post: Trusting all certificates using HttpClient over HTTPS

虽然使用自定义证书建立安全连接稍微复杂一些,但它会给你带来你想要的ssl加密安全,没有中间人攻击的危险!

Although it is a bit more complex to establish a secure connection with a custom certificate, it will bring you the wanted ssl encryption security without the danger of man in the middle attack!