在 iOS 中打开 WebSocket 时出现错误(CFNetwork SSLHandshake 失败(-9807))。

huangapple go评论110阅读模式
英文:

error during opening websocket in IOS (CFNetwork SSLHandshake failed (-9807))

问题

一切在两天前服务器上都正常运行。然后突然之间iOS开始出现问题。iOS现在无法与服务器建立WebSocket连接。以下是iOS的日志记录:

2020-04-04 10:51:35.122783-0300 xxxxx[5880:99324] TCP连接0x600000089c80 SSL握手失败(-9807)
2020-04-04 10:51:35.124999-0300 xxxxx[5880:99077] webSocket打开错误=无法完成操作。
webSocket关闭代码=0,原因=(null),wasClean=1
2020-04-04 10:51:35.604654-0300 xxxx[5880:99324] CFNetwork SSL握手失败(-9807)
2020-04-04 10:51:35.604788-0300 xxxx[5880:99324] TCP连接0x600000089d40 SSL握手失败(-9807)
2020-04-04 10:51:35.605253-0300 xxxx[5880:99077] webSocket打开错误=无法完成操作(OSStatus错误-9807)。

我的服务器是用Java编写的,我使用了Spring WebSocket。

我搜索了这个错误,但没有找到解决这个问题的方法。我不确定是应该在iOS上修复还是在服务器上修复。请帮助我解决这个问题。

英文:

Everything worked fine in the server two days ago. Then Suddenly IOS started not work. IOS cannot open websocket with server now. Those are the logs from IOS.

2020-04-04 10:51:35.122783-0300 xxxxx[5880:99324] TCP Conn 0x600000089c80 SSLHandshake failed (-9807)
2020-04-04 10:51:35.124999-0300 xxxxx[5880:99077] webSocket open error = The operation couldn’t be completed.
webSocket close code = 0, reason = (null), wasClean = 1
2020-04-04 10:51:35.604654-0300 xxxx[5880:99324] CFNetwork SSLHandshake failed (-9807)
2020-04-04 10:51:35.604788-0300 xxxx[5880:99324] TCP Conn 0x600000089d40 SSLHandshake failed (-9807)
2020-04-04 10:51:35.605253-0300 xxxx[5880:99077] webSocket open error = The operation couldn’t be completed. (OSStatus error -9807.)

My Server is written by java. I use spring webscoket.
I searched this error but I didn't find anything which would solve this problem.
And I cannot understand I must fix this in IOS or in the server.
please help me fixing this problem,

答案1

得分: 0

最终,我解决了这个问题。起初,我生成了新的 SSL 证书。然后,我在所有的 Nginx 配置文件中更改了 TLS 协议,你可以在这里找到如何操作:https://libre-software.net/tls-nginx/。我进行了测试,现在一切都正常了。

英文:

In the end I fixed this problem. At first I generated new ssl certificate. Then I changed tls protocol in all nginx config files so https://libre-software.net/tls-nginx/ here you
can find how to do that.I tested and everythink is fine now.

huangapple
  • 本文由 发表于 2020年4月5日 00:07:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/61030891.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定