We are sending one get API call request to fetch user profile data. As of now this request is working fine till iOS 11.2 version. We updated Xcode to 9.4.1 and ran application with iOS 11.3 but it fails with below error :
Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this server is invalid. You might be connecting to a server that is pretending to be ““Server URL” which could put your confidential information at risk." UserInfo={NSURLErrorFailingURLPeerTrustErrorKey=<SecTrustRef: 0x600000305e80>, NSLocalizedRecoverySuggestion=Would you like to connect to the server anyway?, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9807, NSErrorPeerCertificateChainKey=(
"<cert(0x7f8d6a1ce200) s: *“Server URL: GeoTrust SSL CA - G3>",
"<cert(0x7f8d6a0dca00) s: GeoTrust SSL CA - G3 i: GeoTrust Global CA>"
), NSUnderlyingError=0x608000657100 {Error Domain=kCFErrorDomainCFNetwork Code=-1202 "(null)" UserInfo={_kCFStreamPropertySSLClientCertificateState=0, kCFStreamPropertySSLPeerTrust=<SecTrustRef: 0x600000305e80>, _kCFNetworkCFStreamSSLErrorOriginalValue=-9807, _kCFStreamErrorDomainKey=3, _kCFStreamErrorCodeKey=-9807, kCFStreamPropertySSLPeerCertificates=(
"<cert(0x7f8d6a1ce200) s: *API path: GeoTrust SSL CA - G3>",
"<cert(0x7f8d6a0dca00) s: GeoTrust SSL CA - G3 i: GeoTrust Global CA>"
)}}, NSLocalizedDescription=The certificate for this server is invalid. You might be connecting to a server that is pretending to be “Server URL” which could put your confidential information at risk., NSErrorFailingURLKey=, NSErrorFailingURLStringKey="API path", NSErrorClientCertificateStateKey=0}
Could anyone please help to resolve this issue ? Could not figure out why this request is failing iOS 11.3 onwards ?