File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -396,8 +396,13 @@ - (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection __unused *)connect
396
396
397
397
- (void )connection : (NSURLConnection *)connection willSendRequestForAuthenticationChallenge : (NSURLAuthenticationChallenge *)challenge {
398
398
if ([challenge.protectionSpace.authenticationMethod isEqualToString: NSURLAuthenticationMethodServerTrust ]) {
399
- NSURLCredential *credential = [NSURLCredential credentialForTrust: challenge.protectionSpace.serverTrust];
400
- [[challenge sender ] useCredential: credential forAuthenticationChallenge: challenge];
399
+ if (!(self.options & SDWebImageDownloaderAllowInvalidSSLCertificates) &&
400
+ [challenge.sender respondsToSelector: @selector (performDefaultHandlingForAuthenticationChallenge: )]) {
401
+ [challenge.sender performDefaultHandlingForAuthenticationChallenge: challenge];
402
+ } else {
403
+ NSURLCredential *credential = [NSURLCredential credentialForTrust: challenge.protectionSpace.serverTrust];
404
+ [[challenge sender ] useCredential: credential forAuthenticationChallenge: challenge];
405
+ }
401
406
} else {
402
407
if ([challenge previousFailureCount ] == 0 ) {
403
408
if (self.credential ) {
You can’t perform that action at this time.
0 commit comments