我对p12证书和amazon iot有一种奇怪的行为。
如果我在项目ide中包含一个p12文件,并连接到aws iot,那么每件事都可以正常工作
NSBundle *bundle = [NSBundle mainBundle];
NSString *resource = [bundle pathForResource:nil ofType:@"p12"];
certificate = [NSData dataWithContentsOfFile:resource];
[self continueConnect:certificate];
但如果我从服务器下载证书并保存到本地文件
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *appFile = [documentsDirectory stringByAppendingString:@"/certificate.p12"];
certificate = [NSData dataWithContentsOfFile:appFile];
[self continueConnect:certificate];
我收到以下错误:CFNetwork SSLHandshake失败(-9829)
我已经在for循环中检查了两个证书都是缩进的
任何提示?