When I tried to login to the application using a webservice.
I also set my plist-file
like the following
I got the following error. This error showing on my console
TIC SSL Trust Error [5:0x1c017fbc0]: 3:0
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
Task <E0C414FF-98C7-4E6B-876F-B9006465C8FD>.<1> HTTP load failed (error code: -1200 [3:-9802]
IKKA - s answer in Swift 4.2 version
extension CustomViewController: URLSessionDelegate {
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
if (challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodClientCertificate) {
completionHandler(.rejectProtectionSpace, nil)
}
if (challenge.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust) {
let credential = URLCredential(trust: challenge.protectionSpace.serverTrust!)
completionHandler(.useCredential, credential)
}
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With