Skip to content

Commit

Permalink
Revert "fix(webview): authenticationMethod NSURLAuthenticationMethodC…
Browse files Browse the repository at this point in the history
…lientCertificate not handled correctly (#13352)" (#13354)

This reverts commit edfd037.
  • Loading branch information
hansemannn authored Apr 1, 2022
1 parent edfd037 commit 827752f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
5 changes: 1 addition & 4 deletions iphone/Classes/TiUIWebView.m
Original file line number Diff line number Diff line change
Expand Up @@ -880,13 +880,10 @@ - (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAut
completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
}
// HTTPS in general
} else if ([authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]
|| [authenticationMethod isEqualToString:NSURLAuthenticationMethodClientCertificate]) {
} else if ([authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]) {
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
// Default: Reject authentication challenge
} else {
// Not sure why not let the DefaultHandling handle this but at least warn in the log because of canceled challenge
NSLog(@"[WARN] Ti.UI.WebView canceled unknown authentication challenge with method %@", authenticationMethod);
completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
}
}
Expand Down
20 changes: 0 additions & 20 deletions tests/Resources/ti.ui.webview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -950,24 +950,4 @@ describe('Titanium.UI.WebView', function () {
win.open();
});
});

it('url with clientCertChallenge', function (finish) {
const url = 'https://device.login.microsoftonline.com';

win = Ti.UI.createWindow();
const webView = Ti.UI.createWebView({
url: url
});

webView.addEventListener('error', function () {
finish(new Error('clientCertChallenge must be handled correctly.'));
});

webView.addEventListener('load', function () {
finish();
});

win.add(webView);
win.open();
});
});

0 comments on commit 827752f

Please sign in to comment.