Setting default SSL Pinning Mode in example to None only if host name does not match

This commit is contained in:
Mattt Thompson 2013-07-15 09:43:27 -07:00
Родитель 77225e955a
Коммит b5d003451d
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -51,11 +51,11 @@ static NSString * const kAFAppDotNetAPIBaseURLString = @"https://alpha-api.app.n
// 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. // 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"]) { if ([[url scheme] isEqualToString:@"https"] && [[url host] isEqualToString:@"alpha-api.app.net"]) {
[self setDefaultSSLPinningMode:AFSSLPinningModePublicKey]; self.defaultSSLPinningMode = AFSSLPinningModePublicKey;
} else {
self.defaultSSLPinningMode = AFSSLPinningModeNone;
} }
self.defaultSSLPinningMode = AFSSLPinningModeNone;
return self; return self;
} }