I've noticed that our apps get these errors with some regular occurrence:
Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made.
I suspect the issue may be because of misconfigured VPNs. But is there any way to get more details about the cause of these SSL failures? If it's an issue with certificate validation or something, it would be great to get the certificate seen at the time of the error as sometimes a simple retry ends up working.
I'm not doing anything particularly special network-wise... using standard URLSession
with the default configuration. I have tried implementing URLSessionDelegate.urlSession(:didBecomeInvalidWithError:)
and URLSessionDelegate.urlSession(:didReceive:completionHandler:)
to see if I could get more details, but nothing.