Android 客户端通过 SSL 连接到服务器
我正在尝试通过 SSL 创建从 Android 客户端到服务器的 SSL 连接。 一开始,
我总是收到javax.net.ssl.SSLHandshakeException: no cipher suites in common on the server
当尝试连接时,
。经过一番调查,我意识到 Android 使用 Bouncy Castle SSL 实现,并且其中的密码套件与 SUN 提供的不同。所以我已将 Bouncy Castle 提供程序添加到服务器。原来的问题消失了,但我现在
在线程“main”javax.net.ssl.SSLHandshakeException中得到异常:没有找到服务器证书
我不确定为什么会得到这个。我已经生成了证书。当然,我使用 JKS 来存储它,但这有什么关系呢?只是一种存储格式,证书应该是完全一样的。
如果有人使用 SSL 在 Android 上完成了非 HTTP 客户端服务器编程,我将非常感谢任何有关我需要做什么的指示。
I am trying to create an SSL connection from android client to the server over SSL.
In the very beginning I was always getting
javax.net.ssl.SSLHandshakeException: no cipher suites in common on the server
when connection was attempted.
After some investigation I realized that Android uses Bouncy Castle SSL implementation and the cipher suites there are different from those SUN provides. So I've added Bouncy Castle provider to the server. The original problem went away, but I now get
Exception in thread "main" javax.net.ssl.SSLHandshakeException: NO SERVER CERTIFICATE FOUND
I am not sure why I get this. I have generated the certificate. Granted I am using JKS to store it, but why would it matter? It's just a format of storage, the certificate should be exactly the same.
If anyone has done non HTTP client server programming on Android using SSL I would really appreciate any pointers on what I need to do.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当我收到此消息时,原因是服务器没有加载正确的服务器证书。因此,请仔细检查您的服务器是否确实具有可提供的证书。
When I got this, the reason was that the server didn't have proper server certificate loaded. So double-check your server indeed has certificate to offer.