处理上架的问题
1:处理了openurl 拉起问题 2:去掉了http 3 隐私等等
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
//
|
||||
|
||||
#import "NetworkStreamHandler.h"
|
||||
#import <Security/Security.h>
|
||||
|
||||
@interface NetworkStreamHandler ()
|
||||
|
||||
@@ -243,8 +244,26 @@ didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
|
||||
|
||||
// 处理 SSL 认证挑战
|
||||
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
|
||||
NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
|
||||
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
|
||||
SecTrustRef trust = challenge.protectionSpace.serverTrust;
|
||||
if (!trust) {
|
||||
completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
|
||||
return;
|
||||
}
|
||||
BOOL ok = NO;
|
||||
if (@available(iOS 13.0, *)) {
|
||||
ok = SecTrustEvaluateWithError(trust, nil);
|
||||
} else {
|
||||
SecTrustResultType result = kSecTrustResultInvalid;
|
||||
OSStatus status = SecTrustEvaluate(trust, &result);
|
||||
ok = (status == errSecSuccess) &&
|
||||
(result == kSecTrustResultUnspecified || result == kSecTrustResultProceed);
|
||||
}
|
||||
if (ok) {
|
||||
NSURLCredential *credential = [NSURLCredential credentialForTrust:trust];
|
||||
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
|
||||
} else {
|
||||
completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
|
||||
}
|
||||
} else {
|
||||
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user