Added runtime check to disable pinning in the example

Signed-off-by: Mattt Thompson <m@mattt.me>
This commit is contained in:
Kevin Harwood 2013-04-16 10:31:41 +03:00 коммит произвёл Mattt Thompson
Родитель b3267b85b0
Коммит 3c6bec4207
1 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@ -49,7 +49,10 @@ static NSString * const kAFAppDotNetAPIBaseURLString = @"https://alpha-api.app.n
// Accept HTTP Header; see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1
[self setDefaultHeader:@"Accept" value:@"application/json"];
// By default, the example ships with SSL pinning enabled for the app.net API pinned against the public key of adn.cer file included with the example. In order to make it easier for developers who are new to AFNetworking, SSL pinning is automatically disabled if the base URL has been changed. This will allow developers to hack around with the example, without getting tripped up by SSL pinning.
if ([[url scheme] isEqualToString:@"https"] && [[url host] isEqualToString:@"alpha-api.app.net"]) {
[self setDefaultSSLPinningMode:AFSSLPinningModePublicKey];
}
return self;
}