diff --git a/AFNetworking/AFHTTPClient.h b/AFNetworking/AFHTTPClient.h index f866ab0..fa6f51d 100644 --- a/AFNetworking/AFHTTPClient.h +++ b/AFNetworking/AFHTTPClient.h @@ -150,7 +150,7 @@ typedef enum { 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 allowsInvalidSSLCertificate; +@property (nonatomic, assign) BOOL allowsInvalidSSLCertificate; ///--------------------------------------------- /// @name Creating and Initializing HTTP Clients diff --git a/AFNetworking/AFHTTPClient.m b/AFNetworking/AFHTTPClient.m index b745847..e23f2a0 100644 --- a/AFNetworking/AFHTTPClient.m +++ b/AFNetworking/AFHTTPClient.m @@ -1102,7 +1102,7 @@ static const NSUInteger AFMultipartBodyStreamProviderDefaultBufferLength = 4096; [_buffer setLength:numberOfBytesRead]; - if(numberOfBytesRead == 0) { + if (numberOfBytesRead == 0) { self.currentHTTPBodyPart = nil; } diff --git a/AFNetworking/AFURLConnectionOperation.m b/AFNetworking/AFURLConnectionOperation.m index f3c0020..41034a1 100644 --- a/AFNetworking/AFURLConnectionOperation.m +++ b/AFNetworking/AFURLConnectionOperation.m @@ -637,7 +637,7 @@ willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challe - (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace { - if(self.allowsInvalidSSLCertificate == YES && + if (self.allowsInvalidSSLCertificate && [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) { return YES; }