Renaming allowInvalidSSLCertificate -> allowsInvalidSSLCertificate
This commit is contained in:
parent
174bc47c84
commit
9cbc749d40
4 changed files with 17 additions and 15 deletions
|
|
@ -146,9 +146,11 @@ typedef enum {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The flag to determine if each `AFHTTPRequestOperation` that is created in `HTTPRequestOperationWithRequest` should accept an invalid SSL certificate. If `_AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_` is set, this property defaults to YES for backwards compatibility support. Otherwise, this property defaults to NO.
|
Whether each `AFHTTPRequestOperation` that is created in `HTTPRequestOperationWithRequest` should accept an invalid SSL certificate.
|
||||||
|
|
||||||
|
If `_AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_` is set, this property defaults to `YES` for backwards compatibility. Otherwise, this property defaults to `NO`.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic,assign) BOOL allowInvalidSSLCertificate;
|
@property (nonatomic,assign) BOOL allowsInvalidSSLCertificate;
|
||||||
|
|
||||||
///---------------------------------------------
|
///---------------------------------------------
|
||||||
/// @name Creating and Initializing HTTP Clients
|
/// @name Creating and Initializing HTTP Clients
|
||||||
|
|
|
||||||
|
|
@ -263,9 +263,9 @@ NSArray * AFQueryStringPairsFromKeyAndValue(NSString *key, id value) {
|
||||||
self.operationQueue = [[NSOperationQueue alloc] init];
|
self.operationQueue = [[NSOperationQueue alloc] init];
|
||||||
[self.operationQueue setMaxConcurrentOperationCount:NSOperationQueueDefaultMaxConcurrentOperationCount];
|
[self.operationQueue setMaxConcurrentOperationCount:NSOperationQueueDefaultMaxConcurrentOperationCount];
|
||||||
|
|
||||||
//This ifdef has been added for backwards compatibility purposes
|
// #ifdef included for backwards-compatibility
|
||||||
#ifdef _AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_
|
#ifdef _AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_
|
||||||
self.allowInvalidSSLCertificate = YES;
|
self.allowsInvalidSSLCertificate = YES;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|
@ -541,7 +541,7 @@ static void AFNetworkReachabilityReleaseCallback(const void *info) {
|
||||||
#ifdef _AFNETWORKING_PIN_SSL_CERTIFICATES_
|
#ifdef _AFNETWORKING_PIN_SSL_CERTIFICATES_
|
||||||
operation.SSLPinningMode = self.defaultSSLPinningMode;
|
operation.SSLPinningMode = self.defaultSSLPinningMode;
|
||||||
#endif
|
#endif
|
||||||
operation.allowInvalidSSLCertificate = self.allowInvalidSSLCertificate;
|
operation.allowsInvalidSSLCertificate = self.allowsInvalidSSLCertificate;
|
||||||
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ NSCoding, NSCopying>
|
||||||
|
|
||||||
If `_AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_` is set, this property defaults to `YES` for backwards compatibility. Otherwise, this property defaults to `NO`.
|
If `_AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_` is set, this property defaults to `YES` for backwards compatibility. Otherwise, this property defaults to `NO`.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, assign) BOOL allowInvalidSSLCertificate;
|
@property (nonatomic, assign) BOOL allowsInvalidSSLCertificate;
|
||||||
|
|
||||||
///----------------------------
|
///----------------------------
|
||||||
/// @name Getting Response Data
|
/// @name Getting Response Data
|
||||||
|
|
@ -287,7 +287,7 @@ NSCoding, NSCopying>
|
||||||
|
|
||||||
@param block A block object to be executed to determine whether the connection should be able to respond to a protection space's form of authentication. The block has a `BOOL` return type and takes two arguments: the URL connection object, and the protection space to authenticate against.
|
@param block A block object to be executed to determine whether the connection should be able to respond to a protection space's form of authentication. The block has a `BOOL` return type and takes two arguments: the URL connection object, and the protection space to authenticate against.
|
||||||
|
|
||||||
If `allowInvalidSSLCertificate` is set to YES, `connection:canAuthenticateAgainstProtectionSpace:` will accept invalid SSL certificates, returning `YES` if the protection space authentication method is `NSURLAuthenticationMethodServerTrust`.
|
If `allowsInvalidSSLCertificate` is set to YES, `connection:canAuthenticateAgainstProtectionSpace:` will accept invalid SSL certificates, returning `YES` if the protection space authentication method is `NSURLAuthenticationMethodServerTrust`.
|
||||||
*/
|
*/
|
||||||
- (void)setAuthenticationAgainstProtectionSpaceBlock:(BOOL (^)(NSURLConnection *connection, NSURLProtectionSpace *protectionSpace))block;
|
- (void)setAuthenticationAgainstProtectionSpaceBlock:(BOOL (^)(NSURLConnection *connection, NSURLProtectionSpace *protectionSpace))block;
|
||||||
|
|
||||||
|
|
@ -296,7 +296,7 @@ NSCoding, NSCopying>
|
||||||
|
|
||||||
@param block A block object to be executed when the connection must authenticate a challenge in order to download its request. The block has no return type and takes two arguments: the URL connection object, and the challenge that must be authenticated.
|
@param block A block object to be executed when the connection must authenticate a challenge in order to download its request. The block has no return type and takes two arguments: the URL connection object, and the challenge that must be authenticated.
|
||||||
|
|
||||||
If `allowInvalidSSLCertificate` is set to YES, `connection:didReceiveAuthenticationChallenge:` will attempt to have the challenge sender use credentials with invalid SSL certificates.
|
If `allowsInvalidSSLCertificate` is set to YES, `connection:didReceiveAuthenticationChallenge:` will attempt to have the challenge sender use credentials with invalid SSL certificates.
|
||||||
*/
|
*/
|
||||||
- (void)setAuthenticationChallengeBlock:(void (^)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge))block;
|
- (void)setAuthenticationChallengeBlock:(void (^)(NSURLConnection *connection, NSURLAuthenticationChallenge *challenge))block;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,7 +260,7 @@ static inline BOOL AFStateTransitionIsValid(AFOperationState fromState, AFOperat
|
||||||
|
|
||||||
// #ifdef included for backwards-compatibility
|
// #ifdef included for backwards-compatibility
|
||||||
#ifdef _AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_
|
#ifdef _AFNETWORKING_ALLOW_INVALID_SSL_CERTIFICATES_
|
||||||
self.allowInvalidSSLCertificate = YES;
|
self.allowsInvalidSSLCertificate = YES;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|
@ -611,7 +611,7 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case AFSSLPinningModeNone: {
|
case AFSSLPinningModeNone: {
|
||||||
if (self.allowInvalidSSLCertificate){
|
if (self.allowsInvalidSSLCertificate){
|
||||||
NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust];
|
NSURLCredential *credential = [NSURLCredential credentialForTrust:serverTrust];
|
||||||
[[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
|
[[challenge sender] useCredential:credential forAuthenticationChallenge:challenge];
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -637,7 +637,7 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe
|
||||||
- (BOOL)connection:(NSURLConnection *)connection
|
- (BOOL)connection:(NSURLConnection *)connection
|
||||||
canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
|
canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
|
||||||
{
|
{
|
||||||
if(self.allowInvalidSSLCertificate == YES &&
|
if(self.allowsInvalidSSLCertificate == YES &&
|
||||||
[protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
|
[protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
@ -655,7 +655,7 @@ canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace
|
||||||
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
|
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
|
||||||
{
|
{
|
||||||
|
|
||||||
if (self.allowInvalidSSLCertificate
|
if (self.allowsInvalidSSLCertificate
|
||||||
&& [challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
|
&& [challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
|
||||||
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];
|
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];
|
||||||
return;
|
return;
|
||||||
|
|
@ -808,7 +808,7 @@ didReceiveResponse:(NSURLResponse *)response
|
||||||
self.error = [aDecoder decodeObjectForKey:@"error"];
|
self.error = [aDecoder decodeObjectForKey:@"error"];
|
||||||
self.responseData = [aDecoder decodeObjectForKey:@"responseData"];
|
self.responseData = [aDecoder decodeObjectForKey:@"responseData"];
|
||||||
self.totalBytesRead = [[aDecoder decodeObjectForKey:@"totalBytesRead"] longLongValue];
|
self.totalBytesRead = [[aDecoder decodeObjectForKey:@"totalBytesRead"] longLongValue];
|
||||||
self.allowInvalidSSLCertificate = [[aDecoder decodeObjectForKey:@"allowInvalidSSLCertificate"] boolValue];
|
self.allowsInvalidSSLCertificate = [[aDecoder decodeObjectForKey:@"allowsInvalidSSLCertificate"] boolValue];
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
@ -833,7 +833,7 @@ didReceiveResponse:(NSURLResponse *)response
|
||||||
[aCoder encodeObject:self.error forKey:@"error"];
|
[aCoder encodeObject:self.error forKey:@"error"];
|
||||||
[aCoder encodeObject:self.responseData forKey:@"responseData"];
|
[aCoder encodeObject:self.responseData forKey:@"responseData"];
|
||||||
[aCoder encodeObject:[NSNumber numberWithLongLong:self.totalBytesRead] forKey:@"totalBytesRead"];
|
[aCoder encodeObject:[NSNumber numberWithLongLong:self.totalBytesRead] forKey:@"totalBytesRead"];
|
||||||
[aCoder encodeObject:[NSNumber numberWithBool:self.allowInvalidSSLCertificate] forKey:@"allowInvalidSSLCertificate"];
|
[aCoder encodeObject:[NSNumber numberWithBool:self.allowsInvalidSSLCertificate] forKey:@"allowsInvalidSSLCertificate"];
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark - NSCopying
|
#pragma mark - NSCopying
|
||||||
|
|
@ -847,7 +847,7 @@ didReceiveResponse:(NSURLResponse *)response
|
||||||
operation.authenticationChallenge = self.authenticationChallenge;
|
operation.authenticationChallenge = self.authenticationChallenge;
|
||||||
operation.cacheResponse = self.cacheResponse;
|
operation.cacheResponse = self.cacheResponse;
|
||||||
operation.redirectResponse = self.redirectResponse;
|
operation.redirectResponse = self.redirectResponse;
|
||||||
operation.allowInvalidSSLCertificate = self.allowInvalidSSLCertificate;
|
operation.allowsInvalidSSLCertificate = self.allowsInvalidSSLCertificate;
|
||||||
|
|
||||||
return operation;
|
return operation;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue