You are connecting to a site with untrusted certificate.
About the error code:
Its error domain kCFStreamErrorDomainSSL and as per CFStream doc error code belonging to this domain can be found in SecureTransport.h file.
As per this file -9824 is
errSSLPeerHandshakeFail = -9824, /* handshake failure */
Solution is to obtain a certificate from a known certificate authority or add that certificate to the trusted list of certificates in your keychain.
Whenever you try to connect to site with untrusted certificate following API is invoked to make a decision about this untrusted certificate. You most probably need to implement this NSURLConnectionDelegate method
- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
Inside this method you can call following to investigate about certificates.
SecTrustRef trust = [[challenge protectionSpace] serverTrust];
SecCertificateRef leafCert = SecTrustGetCertificateAtIndex(trust, 0);