I am fetching data using AFNetworking(2.5). in that i also set the "setAllowInvalidCertificates:YES" but still i am getting the error
CFNetwork SSLHandshake failed (-9806)
CFNetwork SSLHandshake failed (-9800)
CFNetwork SSLHandshake failed (-9830)
NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9830)
WebClientERROR: An SSL error has occurred and a secure connection to the server cannot be made.
see, i am using this code
AFSecurityPolicy *policy = [AFSecurityPolicy policyWithPinningMode:AFSSLPinningModeNone];
[policy setAllowInvalidCertificates:YES];
[op setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
NSLog(@"JSON: %@", responseObject);
if (completion) {
completion([[UMWebResponse alloc] initWithJSON:responseObject]);
}
} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
if (completion) {
if (operation.responseObject) {
if (error.code == 401) {
[APPDELEGATE showLoginViewController];
}
completion([[UMWebResponse alloc] initWithJSON:operation.responseObject]);
} else {
if (error.code == 401) {
[APPDELEGATE showLoginViewController];
}
completion([[UMWebResponse alloc] initWithError:error]);
}
}
}];
[[NSOperationQueue mainQueue] addOperation:op];
return op;