在使用iOS 10升级到Xcode 8后,我得到了这个错误.我是最新的El Capitan并使用以下版本的ruby(我通过rvm更新,与2.0.0系统版本相同)和CFPropertyList:
Philipps-MacBook-Pro:mobile-sdk prakuschan$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]
Philipps-MacBook-Pro:mobile-sdk prakuschan$ gem list CF
*** LOCAL GEMS ***
CFPropertyList (2.3.3)
Run Code Online (Sandbox Code Playgroud)
xcodebuild -exportArchive命令在shell脚本中执行,成功归档后,我收到以下错误:
** ARCHIVE SUCCEEDED **
2016-09-22 10:02:16.460 xcodebuild[10375:8369748] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/9y/r64c9wld0jx2yf3glsrzhhr00000gn/T/AppName_2016-09-22_10-02-16.456.xcdistributionlogs'.
2016-09-22 10:02:18.228 xcodebuild[10375:8369748] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fe435f9dfb0>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.
Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.} …Run Code Online (Sandbox Code Playgroud) 目前我正在开发一个使用相互身份验证的应用程序,以便与REST接口进行通信.因为我对这个主题很陌生,所以我研究了几个例子 - 现在我有一些问题.我希望我能够将所有知识片段放在一起,以便更好地了解整个过程.
该过程应如下所示:
我用于为第一个请求执行SSL固定的代码如下所示,SSL Pinning按预期工作.
- (void)connection:(NSURLConnection *)connection
willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
{
NSString *cerPath = [[NSBundle mainBundle] pathForResource:@"server-cert" ofType:@"cer"];
SecTrustRef serverTrust = challenge.protectionSpace.serverTrust;
SecCertificateRef certificate = SecTrustGetCertificateAtIndex(serverTrust, 0);
NSData *remoteCertificateData = CFBridgingRelease(SecCertificateCopyData(certificate));
NSData *localCertificateData = [NSData dataWithContentsOfFile:cerPath];
if ([remoteCertificateData isEqualToData:localCertificateData]) {
NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust];
[[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
[[NSURLCredentialStorage sharedCredentialStorage] setCredential:credential forProtectionSpace:[challenge protectionSpace]];
NSLog(@"Certificate Pinning Succeeded");
} else {
[[challenge sender] cancelAuthenticationChallenge:challenge];
NSLog(@"Certificate Pinning Failed");
}
}
Run Code Online (Sandbox Code Playgroud)
但是如何处理来自服务器的返回证书?据我所知,我必须使用以下NSURLConnection委托方法 - 并以某种方式向服务器提供此证书(用于进一步的请求).
- (BOOL)connection:(NSURLConnection *)connection …Run Code Online (Sandbox Code Playgroud)