|
@@ -140,11 +140,14 @@ static SecCertificateRef SecTrustGetLeafCertificate(SecTrustRef trust)
|
|
X509_free(x509cert);
|
|
X509_free(x509cert);
|
|
}
|
|
}
|
|
|
|
|
|
-- (void)presentViewControllerCertificateWithAccount:(NSString *)account delegate:(id)delegate
|
|
|
|
|
|
+- (void)presentViewControllerCertificateWithAccount:(NSString *)account viewController:(UIViewController *)viewController delegate:(id)delegate
|
|
{
|
|
{
|
|
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
|
|
_delegate = delegate;
|
|
_delegate = delegate;
|
|
|
|
|
|
|
|
+ if (![viewController isKindOfClass:[UIViewController class]])
|
|
|
|
+ return;
|
|
|
|
+
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
|
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
|
|
|
|
|
|
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_ssl_certificate_untrusted_", nil) message:NSLocalizedString(@"_connect_server_anyway_", nil) preferredStyle:UIAlertControllerStyleAlert];
|
|
UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_ssl_certificate_untrusted_", nil) message:NSLocalizedString(@"_connect_server_anyway_", nil) preferredStyle:UIAlertControllerStyleAlert];
|
|
@@ -167,7 +170,7 @@ static SecCertificateRef SecTrustGetLeafCertificate(SecTrustRef trust)
|
|
[self.delegate trustedCerticateDenied];
|
|
[self.delegate trustedCerticateDenied];
|
|
}]];
|
|
}]];
|
|
|
|
|
|
- [appDelegate.window.rootViewController presentViewController:alertController animated:YES completion:^{
|
|
|
|
|
|
+ [viewController presentViewController:alertController animated:YES completion:^{
|
|
// Stop timer error network
|
|
// Stop timer error network
|
|
[appDelegate.timerErrorNetworking invalidate];
|
|
[appDelegate.timerErrorNetworking invalidate];
|
|
}];
|
|
}];
|