I have some code to perform https request using NSURLSession in objective-C
In - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler
my app loads the server certificate and checks the remote.
It works fine with iOS 9 and iOS10.
(code is similar as posted by eskimo1 in swift: https://forums.developer.apple.com/message/229390#229390)
However in iOS 11, after calling:
NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
completionHandler(NSURLSessionAuthChallengeUseCredential,credential);
the app crash inside CFNetwork.connection
I filed a radar rdar://32950319
Has someone obeserved the same issue ?