I am trying to call my url using
NSDictionary *landingDetails=[appDelegate landingPage];
NSString *devinf=[UIDevice currentDevice].systemVersion;
NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
NSMutableDictionary *reqDict=[NSMutableDictionary dictionary];
[reqDict setObject:@"refillByScan" forKey:@"appId"];
[reqDict setObject:@"extest1" forKey:@"affId"];
[reqDict setObject:[landingDetails objectForKey:@"token"] forKey:@"token"];
[reqDict setObject:@"0124400-59382" forKey:@"rxNo"];//medication or prescription id
[reqDict setObject:@"appName://handleControlFromScanRefill" forKey:@"appCallBackScheme"];
[reqDict setObject:@"callBackAction" forKey:@"appCallBackAction"];
[reqDict setObject:@"chkExpRx" forKey:@"act"];
[reqDict setObject:@"" forKey:@"trackingId"];
[reqDict setObject:devinf forKey:@"devinf"];
[reqDict setObject:appVersion forKey:@"appver"];
NSString *landingUrl=[landingDetails objectForKey:@"landingUrl"];//my url
request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:landingUrl]];
NSString *jsonRequest = [reqDict JSONRepresentation];
NSLog(@"jsonRequest is %@", jsonRequest);
NSData *requestData = [NSData dataWithBytes:[jsonRequest UTF8String] length:[jsonRequest length]];
[request setHTTPMethod:@"POST"];
[request setValue:[NSString stringWithFormat:@"%d", [requestData length]] forHTTPHeaderField:@"Content-Length"];
[request setHTTPBody: requestData];
con=[[NSURLConnection alloc]initWithRequest:request delegate:self];
[con start];
I am getting this error in my log
2013-11-27 19:43:30.754 WallGreen[5594:3a03] CFNetwork SSLHandshake failed (-9806)
2013-11-27 19:43:31.273 WallGreen[5594:3a03] CFNetwork SSLHandshake failed (-9806)
2013-11-27 19:43:31.799 WallGreen[5594:3a03] CFNetwork SSLHandshake failed (-9806)
2013-11-27 19:43:31.800 WallGreen[5594:3a03] NSURLConnection/CFURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9806)
FWIW: I got the same error number and it was due to an expired certificate, so this is another potential source for the issue.
There is a bug on iOS 8 when using a certificate with hash function SHA512, better use the SHA256. I stuck with this error for weeks.
Normally when I get CFNetwork SSLHandshake failed -(*) Its because of my local wifi network (device is connected to network but not the internet)
Try it again on another network (3G is the quickest solution for me)
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