From db1865da6bd74e925dcce90354690f46996c90fe Mon Sep 17 00:00:00 2001 From: Roman Truba Date: Mon, 27 Jun 2016 20:36:47 +0300 Subject: [PATCH] Allow any certificates for tests, to avoid test failed with SSL connection failure --- VKSdkTests/VKSdkTests.m | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/VKSdkTests/VKSdkTests.m b/VKSdkTests/VKSdkTests.m index 52422b8..2fec54c 100644 --- a/VKSdkTests/VKSdkTests.m +++ b/VKSdkTests/VKSdkTests.m @@ -23,6 +23,12 @@ self.continueAfterFailure = NO; [VKSdk initializeWithAppId:@"3974615" apiVersion:@"5.50"]; + + NSURL *URL = [NSURL URLWithString:@"https://api.vk.com"]; + + [NSURLRequest.class performSelector:NSSelectorFromString(@"setAllowsAnyHTTPSCertificate:forHost:") + withObject:NSNull.null // Just need to pass non-nil here to appear as a BOOL YES, using the NSNull.null singleton is pretty safe + withObject:[URL host]]; } - (void)tearDown {