我正在尝试使用我的网址
- 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];
我的日志中收到此错误
- 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:我得到相同的错误号,这是由于证书过期,所以这是问题的另一个潜在的来源.