From 827752f46a25209c58e167e69a37947040ec0c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans=20Kn=C3=B6chel?= Date: Sat, 2 Apr 2022 00:45:02 +0200 Subject: [PATCH] Revert "fix(webview): authenticationMethod NSURLAuthenticationMethodClientCertificate not handled correctly (#13352)" (#13354) This reverts commit edfd037c4e6f50aa03cd382247d5128bb9292731. --- iphone/Classes/TiUIWebView.m | 5 +---- tests/Resources/ti.ui.webview.test.js | 20 -------------------- 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/iphone/Classes/TiUIWebView.m b/iphone/Classes/TiUIWebView.m index 297d54fdbaa..a872c51a04d 100644 --- a/iphone/Classes/TiUIWebView.m +++ b/iphone/Classes/TiUIWebView.m @@ -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); } } diff --git a/tests/Resources/ti.ui.webview.test.js b/tests/Resources/ti.ui.webview.test.js index e19678c65e5..7e9a7ee2ee7 100644 --- a/tests/Resources/ti.ui.webview.test.js +++ b/tests/Resources/ti.ui.webview.test.js @@ -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(); - }); });