Example usage for android.webkit WebViewClient ERROR_FAILED_SSL_HANDSHAKE

List of usage examples for android.webkit WebViewClient ERROR_FAILED_SSL_HANDSHAKE

Introduction

In this page you can find the example usage for android.webkit WebViewClient ERROR_FAILED_SSL_HANDSHAKE.

Prototype

int ERROR_FAILED_SSL_HANDSHAKE

To view the source code for android.webkit WebViewClient ERROR_FAILED_SSL_HANDSHAKE.

Click Source Link

Document

Failed to perform SSL handshake

Usage

From source file:Main.java

private static boolean canRetryWebView(Context context, int errorCode, String description, String failingUrl) {
    if (errorCode == WebViewClient.ERROR_CONNECT || errorCode == WebViewClient.ERROR_FAILED_SSL_HANDSHAKE
            || errorCode == WebViewClient.ERROR_HOST_LOOKUP || errorCode == WebViewClient.ERROR_TIMEOUT) {
        return true;
    } else {/*w  w w .  jav  a2  s.c  o m*/
        return false;
    }
}

From source file:org.mozilla.focus.webkit.FocusWebViewClient.java

@Override
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
    handler.cancel();//from w  ww  . j a va  2 s .co m

    // Webkit can try to load the favicon for a bad page when you set a new URL. If we then
    // loadErrorPage() again, webkit tries to load the favicon again. We end up in onReceivedSSlError()
    // again, and we get an infinite loop of reloads (we also erroneously show the favicon URL
    // in the toolbar, but that's less noticeable). Hence we check whether this error is from
    // the desired page, or a page resource:
    if (error.getUrl().equals(currentPageURL)) {
        ErrorPage.loadErrorPage(view, error.getUrl(), WebViewClient.ERROR_FAILED_SSL_HANDSHAKE);
    }
}