草庐IT

kSecTrustResultRecoverableTrustFa

全部标签

ios - 对于主题名称不匹配的自签名 CA,SecTrustEvaluate 因 kSecTrustResultRecoverableTrustFailure 而失败

这是我使用自签名证书进行身份验证的非常标准的NSURLConnection回调:-(SecCertificateRef)certRefFromDerNamed:(NSString*)derFileNameresultingDataRef:(CFDataRef*)dataRefPtr{NSString*thePath=[[NSBundlemainBundle]pathForResource:derFileNameofType:@"der"];NSData*certData=[[NSDataalloc]initWithContentsOfFile:thePath];CFDataRefcer

ios - SecTrustEvaluate 总是返回 kSecTrustResultRecoverableTrustFailure 和 SecPolicyCreateSSL

我的应用程序尝试评估自签名证书的服务器信任证书。这适用于SecPolicyCreateBasicX509,但不适用于SecPolicyCreateSSL这是我的代码:if(challenge.protectionSpace.authenticationMethod==NSURLAuthenticationMethodServerTrust){//createtrustfromprotectionspaceSecTrustReftrustRef;inttrustCertificateCount=SecTrustGetCertificateCount(challenge.protectio