File tree 2 files changed +24
-1
lines changed
2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -880,10 +880,13 @@ - (void)webView:(WKWebView *)webView didReceiveAuthenticationChallenge:(NSURLAut
880
880
completionHandler (NSURLSessionAuthChallengeCancelAuthenticationChallenge , nil );
881
881
}
882
882
// HTTPS in general
883
- } else if ([authenticationMethod isEqualToString: NSURLAuthenticationMethodServerTrust ]) {
883
+ } else if ([authenticationMethod isEqualToString: NSURLAuthenticationMethodServerTrust ]
884
+ || [authenticationMethod isEqualToString: NSURLAuthenticationMethodClientCertificate ]) {
884
885
completionHandler (NSURLSessionAuthChallengePerformDefaultHandling , nil );
885
886
// Default: Reject authentication challenge
886
887
} else {
888
+ // Not sure why not let the DefaultHandling handle this but at least warn in the log because of canceled challenge
889
+ NSLog (@" [WARN] Ti.UI.WebView canceled unknown authentication challenge with method %@ " , authenticationMethod);
887
890
completionHandler (NSURLSessionAuthChallengeCancelAuthenticationChallenge , nil );
888
891
}
889
892
}
Original file line number Diff line number Diff line change @@ -950,4 +950,24 @@ describe('Titanium.UI.WebView', function () {
950
950
win . open ( ) ;
951
951
} ) ;
952
952
} ) ;
953
+
954
+ it ( 'url with clientCertChallenge' , function ( finish ) {
955
+ const url = 'https://device.login.microsoftonline.com' ;
956
+
957
+ win = Ti . UI . createWindow ( ) ;
958
+ const webView = Ti . UI . createWebView ( {
959
+ url : url
960
+ } ) ;
961
+
962
+ webView . addEventListener ( 'error' , function ( ) {
963
+ finish ( new Error ( 'clientCertChallenge must be handled correctly.' ) ) ;
964
+ } ) ;
965
+
966
+ webView . addEventListener ( 'load' , function ( ) {
967
+ finish ( ) ;
968
+ } ) ;
969
+
970
+ win . add ( webView ) ;
971
+ win . open ( ) ;
972
+ } ) ;
953
973
} ) ;
You can’t perform that action at this time.
0 commit comments