2

I have integrated Google Analytics 3.15. It is working fine for all other iOS versions than iOS 9.3.2 and 10.0.1. I am getting following error in to this.

NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
Dispatch error: Error Domain=NSURLErrorDomain Code=-1200 "An SSL error has occurred and a secure connection to the server cannot be made." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x1701157b0>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9802, NSErrorPeerCertificateChainKey=(
"<cert(0x1018ed200) s: *.google-analytics.com i: Google Internet Authority G2>",
"<cert(0x1018efa00) s: Google Internet Authority G2 i: GeoTrust Global CA>",
"<cert(0x1018f0200) s: GeoTrust Global CA i: Equifax Secure Certificate Authority>"

I have setup Info.plist on the basis of following analysis. On Terminal I have hit following command:

/usr/bin/nscurl --ats-diagnostics --verbose https://ssl.google-analytics.com

enter image description here

I have got one more information by hitting following command.

curl -kvI https://ssl.google-analytics.com

Output of the above command: enter image description here

Please find my info.plist for ATS: enter image description here I have tried with following links:

Please help me to understand what is the mistake I am doing here.

Xplora
  • 837
  • 3
  • 12
  • 24
Ankit Vyas
  • 7,507
  • 13
  • 56
  • 89
  • Found this https://forums.developer.apple.com/thread/13472. Doesn't really match what you are seeing but mentions that if you turn on requires forward secrecy the requirement for sha2/sh256 is relaxed. It looks like the cert is sha256 but out of curiosity I wonder what would happen if you turned on requires forward secrecy? – JJF Nov 02 '17 at 20:51
  • 1
    Did you try updating the SDK? The latest version is 3.17. – Ayazmon Nov 03 '17 at 07:28
  • Possibly related https://stackoverflow.com/questions/30778579/kcfstreamerrordomainssl-9802-when-connecting-to-a-server-by-ip-address-through – kichik Nov 04 '17 at 03:01

1 Answers1

1

Thanks for the comments but after lots of research I came to know that reason for error.I have fixed by just changing the Date and Time of iPhone to Automatic from Manual.I know it's very simple fix but it took 5 days to analyze and fix.

Ankit Vyas
  • 7,507
  • 13
  • 56
  • 89