ios – 获取CFNetwork SSLHandshake失败(-9806)错误

前端之家收集整理的这篇文章主要介绍了ios – 获取CFNetwork SSLHandshake失败(-9806)错误前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试使用我的网址
  1. NSDictionary *landingDetails=[appDelegate landingPage];
  2.  
  3. NSString *devinf=[UIDevice currentDevice].systemVersion;
  4. NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
  5.  
  6. NSMutableDictionary *reqDict=[NSMutableDictionary dictionary];
  7. [reqDict setObject:@"refillByScan" forKey:@"appId"];
  8. [reqDict setObject:@"extest1" forKey:@"affId"];
  9. [reqDict setObject:[landingDetails objectForKey:@"token"] forKey:@"token"];
  10. [reqDict setObject:@"0124400-59382" forKey:@"rxNo"];//medication or prescription id
  11. [reqDict setObject:@"appName://handleControlFromScanRefill" forKey:@"appCallBackScheme"];
  12. [reqDict setObject:@"callBackAction" forKey:@"appCallBackAction"];
  13. [reqDict setObject:@"chkExpRx" forKey:@"act"];
  14. [reqDict setObject:@"" forKey:@"trackingId"];
  15. [reqDict setObject:devinf forKey:@"devinf"];
  16. [reqDict setObject:appVersion forKey:@"appver"];
  17.  
  18. NSString *landingUrl=[landingDetails objectForKey:@"landingUrl"];//my url
  19. request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:landingUrl]];
  20. NSString *jsonRequest = [reqDict JSONRepresentation];
  21. NSLog(@"jsonRequest is %@",jsonRequest);
  22. NSData *requestData = [NSData dataWithBytes:[jsonRequest UTF8String] length:[jsonRequest length]];
  23.  
  24. [request setHTTPMethod:@"POST"];
  25. [request setValue:[NSString stringWithFormat:@"%d",[requestData length]] forHTTPHeaderField:@"Content-Length"];
  26. [request setHTTPBody: requestData];
  27.  
  28. con=[[NSURLConnection alloc]initWithRequest:request delegate:self];
  29. [con start];

我的日志中收到此错误

  1. 2013-11-27 19:43:30.754 WallGreen[5594:3a03] CFNetwork SSLHandshake Failed (-9806)
  2. 2013-11-27 19:43:31.273 WallGreen[5594:3a03] CFNetwork SSLHandshake Failed (-9806)
  3. 2013-11-27 19:43:31.799 WallGreen[5594:3a03] CFNetwork SSLHandshake Failed (-9806)
  4. 2013-11-27 19:43:31.800 WallGreen[5594:3a03] NSURLConnection/CFURLConnection HTTP load Failed (kcfStreamErrorDomainSSL,-9806)

解决方法

FWIW:我得到相同的错误号,这是由于证书过期,所以这是问题的另一个潜在的来源.

猜你在找的iOS相关文章