diff --git a/Classes/BuschJaegerConfiguration.m b/Classes/BuschJaegerConfiguration.m index 8be8117d4..14c7c1ea1 100644 --- a/Classes/BuschJaegerConfiguration.m +++ b/Classes/BuschJaegerConfiguration.m @@ -257,8 +257,8 @@ } } - [self reloadCertificates]; dispatch_async(dispatch_get_main_queue(), ^{ + [self reloadCertificates]; [delegate buschJaegerConfigurationSuccess]; }); }); @@ -511,6 +511,9 @@ if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { SecTrustRef trust = [challenge.protectionSpace serverTrust]; NSArray *anchors = (NSArray*)certificates; + if(anchors == nil) { + anchors = [NSArray array]; + } SecTrustSetAnchorCertificates(trust, (CFArrayRef)anchors); SecTrustSetAnchorCertificatesOnly(trust, YES);