We've enabled ATS restrictions in our app, and everything works fine, except sometimes, randomly, the endpoint fails. I tried to google the error codes but they seem undocumented. It's a bit hard to provide additional details as the issue is random, but I was hoping someone at Apple could clarify the error codes and possible issues.
Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={_kCFStreamErrorCodeKey=-9858, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x7b0c000b4690 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9858, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9858}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://redacted.url.com, NSErrorFailingURLStringKey=https://redacted.url.com, _kCFStreamErrorDomainKey=3}
error Optional(Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={_kCFStreamErrorCodeKey=-9858, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, NSUnderlyingError=0x7b0c000b4690 {Error Domain=kCFErrorDomainCFNetwork Code=-1200 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, _kCFNetworkCFStreamSSLErrorOriginalValue=-9858, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9858}}, NSLocalizedDescription=An SSL error has occurred and a secure connection to the server cannot be made., NSErrorFailingURLKey=https://redacted.url.com, NSErrorFailingURLStringKey=https://redacted.url.com, _kCFStreamErrorDomainKey=3}))
We've tried `nscurl --ats-diagnostics` on the URL, but everything is fine (and like I said it works most of the time, the issue is just randomly happening).