iOS ECONNRESET with incomplete TLS handshake - generating errSSLClosedNoNotify

前提是你 提交于 2021-02-11 17:01:07

问题


When we try to access one API from the iOS application running on iOS 13 using cellular (4G), it shows intermittent error:

[] -[NWConcrete_nw_address_endpoint initWithAddress:overridePort:] Fixing endpoint address with non-zero sin_zero field
[] tcp_input [C4.1:3] flags=[R.] seq=4011135460, ack=1357945681, win=0 state=ESTABLISHED rcv_nxt=4011135460, snd_una=1357945681
Connection 4: received failure notification
Connection 4: received ECONNRESET with incomplete TLS handshake - generating errSSLClosedNoNotify
Connection 4: failed to connect 3:-9816, reason -1
Connection 4: encountered error(3:-9816)
Task <50BECA08-D337-4DA7-A57C-D04AAAE2367C>.<0> HTTP load failed, 0/0 bytes (error code: -1200 [3:-9816])
NSURLConnection finished with error - code -1200

But, the above error never happens on the same iPhone, same app when connecting to wifi.

Interestingly, when we use the same phone connecting to the same wifi, but using safari to hit the same API, it got no issue.

Any idea why?


回答1:


I created a package to help with TLS Sockets/iOS/Obj-C. I also included a lot of good info about creating certificates correctly given the latest iOS 13 restrictions.

https://github.com/eamonwhiter73/IOSObjCWebSockets/tree/master



来源:https://stackoverflow.com/questions/61348479/ios-econnreset-with-incomplete-tls-handshake-generating-errsslclosednonotify

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!