Loading core/java/android/webkit/BrowserFrame.java +4 −1 Original line number Diff line number Diff line Loading @@ -471,6 +471,7 @@ class BrowserFrame extends Handler { /** * We have received an SSL certificate for the main top-level page. * Used by the Android HTTP stack only. */ void certificate(SslCertificate certificate) { if (mIsMainFrame) { Loading Loading @@ -1178,6 +1179,7 @@ class BrowserFrame extends Handler { if (SslCertLookupTable.getInstance().isAllowed(sslError)) { nativeSslCertErrorProceed(handle); mCallbackProxy.onProceededAfterSslError(sslError); return; } Loading Loading @@ -1267,7 +1269,8 @@ class BrowserFrame extends Handler { } /** * Called by JNI when we load a page over SSL. * Called by JNI when we recieve a certificate for the page's main resource. * Used by the Chromium HTTP stack only. */ private void setCertificate(byte cert_der[]) { try { Loading core/java/android/webkit/CallbackProxy.java +62 −45 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ class CallbackProxy extends Handler { // Used to call startActivity during url override. private final Context mContext; // Message Ids // Message IDs private static final int PAGE_STARTED = 100; private static final int RECEIVED_ICON = 101; private static final int RECEIVED_TITLE = 102; Loading Loading @@ -121,6 +121,7 @@ class CallbackProxy extends Handler { private static final int CLIENT_CERT_REQUEST = 141; private static final int SEARCHBOX_IS_SUPPORTED_CALLBACK = 142; private static final int SEARCHBOX_DISPATCH_COMPLETE_CALLBACK = 143; private static final int PROCEEDED_AFTER_SSL_ERROR = 144; // Message triggered by the client to resume execution private static final int NOTIFY = 200; Loading Loading @@ -349,6 +350,13 @@ class CallbackProxy extends Handler { } break; case PROCEEDED_AFTER_SSL_ERROR: if (mWebViewClient != null) { mWebViewClient.onProceededAfterSslError(mWebView, (SslError) msg.obj); } break; case CLIENT_CERT_REQUEST: if (mWebViewClient != null) { HashMap<String, Object> map = Loading Loading @@ -1024,6 +1032,15 @@ class CallbackProxy extends Handler { sendMessage(msg); } public void onProceededAfterSslError(SslError error) { if (mWebViewClient == null) { return; } Message msg = obtainMessage(PROCEEDED_AFTER_SSL_ERROR); msg.obj = error; sendMessage(msg); } public void onReceivedClientCertRequest(ClientCertRequestHandler handler, String host_and_port) { // Do an unsynchronized quick check to avoid posting if no callback has // been set. Loading core/java/android/webkit/WebViewClient.java +14 −5 Original line number Diff line number Diff line Loading @@ -186,11 +186,11 @@ public class WebViewClient { } /** * Notify the host application to handle a SSL certificate error request * (display the error to the user and ask whether to proceed or not). The * host application has to call either handler.cancel() or handler.proceed() * as the connection is suspended and waiting for the response. The default * behavior is to cancel the load. * Notify the host application that an SSL error occurred while loading a * resource. The host application must call either handler.cancel() or * handler.proceed(). Note that the decision may be retained for use in * response to future SSL errors. The default behavior is to cancel the * load. * * @param view The WebView that is initiating the callback. * @param handler An SslErrorHandler object that will handle the user's Loading @@ -202,6 +202,15 @@ public class WebViewClient { handler.cancel(); } /** * Notify the host application that an SSL error occurred while loading a * resource, but the WebView but chose to proceed anyway based on a * decision retained from a previous response to onReceivedSslError(). * @hide */ public void onProceededAfterSslError(WebView view, SslError error) { } /** * Notify the host application to handle a SSL client certificate * request (display the request to the user and ask whether to Loading Loading
core/java/android/webkit/BrowserFrame.java +4 −1 Original line number Diff line number Diff line Loading @@ -471,6 +471,7 @@ class BrowserFrame extends Handler { /** * We have received an SSL certificate for the main top-level page. * Used by the Android HTTP stack only. */ void certificate(SslCertificate certificate) { if (mIsMainFrame) { Loading Loading @@ -1178,6 +1179,7 @@ class BrowserFrame extends Handler { if (SslCertLookupTable.getInstance().isAllowed(sslError)) { nativeSslCertErrorProceed(handle); mCallbackProxy.onProceededAfterSslError(sslError); return; } Loading Loading @@ -1267,7 +1269,8 @@ class BrowserFrame extends Handler { } /** * Called by JNI when we load a page over SSL. * Called by JNI when we recieve a certificate for the page's main resource. * Used by the Chromium HTTP stack only. */ private void setCertificate(byte cert_der[]) { try { Loading
core/java/android/webkit/CallbackProxy.java +62 −45 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ class CallbackProxy extends Handler { // Used to call startActivity during url override. private final Context mContext; // Message Ids // Message IDs private static final int PAGE_STARTED = 100; private static final int RECEIVED_ICON = 101; private static final int RECEIVED_TITLE = 102; Loading Loading @@ -121,6 +121,7 @@ class CallbackProxy extends Handler { private static final int CLIENT_CERT_REQUEST = 141; private static final int SEARCHBOX_IS_SUPPORTED_CALLBACK = 142; private static final int SEARCHBOX_DISPATCH_COMPLETE_CALLBACK = 143; private static final int PROCEEDED_AFTER_SSL_ERROR = 144; // Message triggered by the client to resume execution private static final int NOTIFY = 200; Loading Loading @@ -349,6 +350,13 @@ class CallbackProxy extends Handler { } break; case PROCEEDED_AFTER_SSL_ERROR: if (mWebViewClient != null) { mWebViewClient.onProceededAfterSslError(mWebView, (SslError) msg.obj); } break; case CLIENT_CERT_REQUEST: if (mWebViewClient != null) { HashMap<String, Object> map = Loading Loading @@ -1024,6 +1032,15 @@ class CallbackProxy extends Handler { sendMessage(msg); } public void onProceededAfterSslError(SslError error) { if (mWebViewClient == null) { return; } Message msg = obtainMessage(PROCEEDED_AFTER_SSL_ERROR); msg.obj = error; sendMessage(msg); } public void onReceivedClientCertRequest(ClientCertRequestHandler handler, String host_and_port) { // Do an unsynchronized quick check to avoid posting if no callback has // been set. Loading
core/java/android/webkit/WebViewClient.java +14 −5 Original line number Diff line number Diff line Loading @@ -186,11 +186,11 @@ public class WebViewClient { } /** * Notify the host application to handle a SSL certificate error request * (display the error to the user and ask whether to proceed or not). The * host application has to call either handler.cancel() or handler.proceed() * as the connection is suspended and waiting for the response. The default * behavior is to cancel the load. * Notify the host application that an SSL error occurred while loading a * resource. The host application must call either handler.cancel() or * handler.proceed(). Note that the decision may be retained for use in * response to future SSL errors. The default behavior is to cancel the * load. * * @param view The WebView that is initiating the callback. * @param handler An SslErrorHandler object that will handle the user's Loading @@ -202,6 +202,15 @@ public class WebViewClient { handler.cancel(); } /** * Notify the host application that an SSL error occurred while loading a * resource, but the WebView but chose to proceed anyway based on a * decision retained from a previous response to onReceivedSslError(). * @hide */ public void onProceededAfterSslError(WebView view, SslError error) { } /** * Notify the host application to handle a SSL client certificate * request (display the request to the user and ask whether to Loading