You can use the NSURLConnection API in asynchronous mode. You will need to implement an object with the NSURLConnectionDelegate protocol (http://developer.apple.com/library/mac/#documentation/Foundation/Reference/NSURLConnectionDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/NSURLConnectionDelegate) .
The delegate will receive a call to the connection:didReceiveAuthenticationChallenge: method when the server is threatened with a certificate.
See the Apple manual for the URL loading system (http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Articles/AuthenticationChallenges.html#//apple_ref/doc/uid/TP40009507-SW1)
To download the SSL certificate from the package, see this fooobar.com/questions/267436 / ... :
source share